Commit e8cade67 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '23315-fix-tags-pagination' into 'master'

Fix container reigstry tags pagination bug

See merge request gitlab-org/gitlab!26815
parents 612675f5 f1a71155
......@@ -102,7 +102,7 @@ export default {
return this.tagsPagination.page;
},
set(page) {
this.requestTagsList({ pagination: { page }, id: this.$route.params.id });
this.requestTagsList({ pagination: { page }, params: this.$route.params.id });
},
},
},
......
......@@ -126,6 +126,7 @@ describe 'Container Registry', :js do
describe 'image repo details' do
before do
stub_container_registry_tags(repository: %r{my/image}, tags: ('1'..'20').to_a, with_manifest: true)
visit_container_registry_details 'my/image'
end
......@@ -140,12 +141,18 @@ describe 'Container Registry', :js do
it 'user removes a specific tag from container repository' do
service = double('service')
expect(service).to receive(:execute).with(container_repository) { { status: :success } }
expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(container_repository.project, user, tags: ['latest']) { service }
expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(container_repository.project, user, tags: ['1']) { service }
click_on(class: 'js-delete-registry')
first('.js-delete-registry').click
expect(find('.modal .modal-title')).to have_content _('Remove tag')
find('.modal .modal-footer .btn-danger').click
end
it('pagination navigate to the second page') do
pagination = find('.gl-pagination')
pagination.click_link('2')
expect(page).to have_content '20'
end
end
end
end
......
......@@ -219,7 +219,7 @@ describe('Details Page', () => {
dispatchSpy.mockResolvedValue();
wrapper.setData({ currentPage: 2 });
expect(store.dispatch).toHaveBeenCalledWith('requestTagsList', {
id: wrapper.vm.$route.params.id,
params: wrapper.vm.$route.params.id,
pagination: { page: 2 },
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment