diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 15:08:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 15:08:35 +0300 |
commit | 22e9af3c8b8aedf7f46b786be968862b74a2d07e (patch) | |
tree | a10a7d9af40a17fe6cda7b3a681f5e5e2112c16e /spec/javascripts/vue_shared | |
parent | c8e28a0bb8dd45d91cb72ff2c930bc4a562f1fc7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts/vue_shared')
-rw-r--r-- | spec/javascripts/vue_shared/components/diff_viewer/diff_viewer_spec.js | 4 | ||||
-rw-r--r-- | spec/javascripts/vue_shared/components/pagination/graphql_pagination_spec.js | 73 |
2 files changed, 2 insertions, 75 deletions
diff --git a/spec/javascripts/vue_shared/components/diff_viewer/diff_viewer_spec.js b/spec/javascripts/vue_shared/components/diff_viewer/diff_viewer_spec.js index c743f1f6ad7..6a83790093a 100644 --- a/spec/javascripts/vue_shared/components/diff_viewer/diff_viewer_spec.js +++ b/spec/javascripts/vue_shared/components/diff_viewer/diff_viewer_spec.js @@ -38,11 +38,11 @@ describe('DiffViewer', () => { setTimeout(() => { expect(vm.$el.querySelector('.deleted img').getAttribute('src')).toBe( - `//raw/DEF/${RED_BOX_IMAGE_URL}`, + `//-/raw/DEF/${RED_BOX_IMAGE_URL}`, ); expect(vm.$el.querySelector('.added img').getAttribute('src')).toBe( - `//raw/ABC/${GREEN_BOX_IMAGE_URL}`, + `//-/raw/ABC/${GREEN_BOX_IMAGE_URL}`, ); done(); diff --git a/spec/javascripts/vue_shared/components/pagination/graphql_pagination_spec.js b/spec/javascripts/vue_shared/components/pagination/graphql_pagination_spec.js deleted file mode 100644 index 9e72a0e2480..00000000000 --- a/spec/javascripts/vue_shared/components/pagination/graphql_pagination_spec.js +++ /dev/null @@ -1,73 +0,0 @@ -import { shallowMount, createLocalVue } from '@vue/test-utils'; -import GraphqlPagination from '~/vue_shared/components/pagination/graphql_pagination.vue'; - -const localVue = createLocalVue(); - -describe('Graphql Pagination component', () => { - let wrapper; - function factory({ hasNextPage = true, hasPreviousPage = true }) { - wrapper = shallowMount(localVue.extend(GraphqlPagination), { - propsData: { - hasNextPage, - hasPreviousPage, - }, - localVue, - }); - } - - afterEach(() => { - wrapper.destroy(); - }); - - describe('without previous page', () => { - beforeEach(() => { - factory({ hasPreviousPage: false }); - }); - - it('renders disabled previous button', () => { - expect(wrapper.find('.js-prev-btn').attributes().disabled).toEqual('true'); - }); - }); - - describe('with previous page', () => { - beforeEach(() => { - factory({ hasPreviousPage: true }); - }); - - it('renders enabled previous button', () => { - expect(wrapper.find('.js-prev-btn').attributes().disabled).toEqual(undefined); - }); - - it('emits previousClicked on click', () => { - wrapper.find('.js-prev-btn').vm.$emit('click'); - - expect(wrapper.emitted().previousClicked.length).toBe(1); - }); - }); - - describe('without next page', () => { - beforeEach(() => { - factory({ hasNextPage: false }); - }); - - it('renders disabled next button', () => { - expect(wrapper.find('.js-next-btn').attributes().disabled).toEqual('true'); - }); - }); - - describe('with next page', () => { - beforeEach(() => { - factory({ hasNextPage: true }); - }); - - it('renders enabled next button', () => { - expect(wrapper.find('.js-next-btn').attributes().disabled).toEqual(undefined); - }); - - it('emits nextClicked on click', () => { - wrapper.find('.js-next-btn').vm.$emit('click'); - - expect(wrapper.emitted().nextClicked.length).toBe(1); - }); - }); -}); |