summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 06:09:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 06:09:28 +0000
commit1635eacd2a9293cd04d21e82def6e2c14ed01242 (patch)
tree257df93e8de5920c325651811af841128f20f2bc /spec
parent5b51129e3356a12283f0ba2da15db897ee30cf1a (diff)
downloadgitlab-ce-1635eacd2a9293cd04d21e82def6e2c14ed01242.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/container_registry_spec.rb35
-rw-r--r--spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js12
-rw-r--r--spec/tasks/gitlab/backup_rake_spec.rb7
3 files changed, 46 insertions, 8 deletions
diff --git a/spec/features/projects/container_registry_spec.rb b/spec/features/projects/container_registry_spec.rb
index de17d831fbd..76c28c17858 100644
--- a/spec/features/projects/container_registry_spec.rb
+++ b/spec/features/projects/container_registry_spec.rb
@@ -149,12 +149,36 @@ describe 'Container Registry', :js do
end
it('pagination navigate to the second page') do
- pagination = find('.gl-pagination')
- pagination.click_link('2')
+ visit_second_page
expect(page).to have_content '20'
end
end
end
+
+ context 'when there are more than 10 images' do
+ before do
+ create_list(:container_repository, 12, project: project)
+ project.container_repositories << container_repository
+ visit_container_registry
+ end
+
+ it 'shows pagination' do
+ expect(page).to have_css '.gl-pagination'
+ end
+
+ it 'pagination goes to second page' do
+ visit_second_page
+ expect(page).to have_content 'my/image'
+ end
+
+ it 'pagination is preserved after navigating back from details' do
+ visit_second_page
+ click_link 'my/image'
+ breadcrumb = find '.breadcrumbs'
+ breadcrumb.click_link 'Container Registry'
+ expect(page).to have_content 'my/image'
+ end
+ end
end
def visit_container_registry
@@ -163,6 +187,11 @@ describe 'Container Registry', :js do
def visit_container_registry_details(name)
visit_container_registry
- click_link(name)
+ click_link name
+ end
+
+ def visit_second_page
+ pagination = find '.gl-pagination'
+ pagination.click_link '2'
end
end
diff --git a/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js b/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js
index 7ce5ece21ee..f04585a6ff4 100644
--- a/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js
+++ b/spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js
@@ -7,14 +7,14 @@ describe('Registry Breadcrumb', () => {
const nameGenerator = jest.fn();
const crumb = {
- classList: ['foo', 'bar'],
+ className: 'foo bar',
tagName: 'div',
innerHTML: 'baz',
querySelector: jest.fn(),
children: [
{
tagName: 'a',
- classList: ['foo'],
+ className: 'foo',
},
],
};
@@ -25,7 +25,7 @@ describe('Registry Breadcrumb', () => {
innerHTML: 'foo',
};
- const crumbs = [crumb, { ...crumb, innerHTML: 'foo' }, { ...crumb, classList: ['baz'] }];
+ const crumbs = [crumb, { ...crumb, innerHTML: 'foo' }, { ...crumb, className: 'baz' }];
const routes = [
{ name: 'foo', meta: { nameGenerator, root: true } },
@@ -121,7 +121,11 @@ describe('Registry Breadcrumb', () => {
});
it('has the same classes as the last children of the crumbs', () => {
- expect(findLastCrumb().classes()).toEqual(lastChildren.classList);
+ expect(
+ findLastCrumb()
+ .classes()
+ .join(' '),
+ ).toEqual(lastChildren.className);
});
it('has a link to the current route', () => {
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
index 3213d00e70e..e042fc58f82 100644
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ b/spec/tasks/gitlab/backup_rake_spec.rb
@@ -23,7 +23,12 @@ describe 'gitlab:app namespace rake task' do
end
before(:all) do
- Rails.application.load_tasks
+ Rake.application.rake_require 'active_record/railties/databases'
+ Rake.application.rake_require 'tasks/gitlab/helpers'
+ Rake.application.rake_require 'tasks/gitlab/backup'
+ Rake.application.rake_require 'tasks/gitlab/shell'
+ Rake.application.rake_require 'tasks/gitlab/db'
+ Rake.application.rake_require 'tasks/cache'
# empty task as env is already loaded
Rake::Task.define_task :environment