diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-07 09:08:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-07 09:08:35 +0300 |
commit | bed53d96d214fd96ea688d3e86e53457ce50043e (patch) | |
tree | 8196df5e612e847c3da3e8f50a0d45d7ae9ea6e0 /spec/frontend/diffs | |
parent | 83cd5db43517cfd977b0d288b179f794677ba1a7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/diffs')
-rw-r--r-- | spec/frontend/diffs/components/diff_expansion_cell_spec.js | 11 | ||||
-rw-r--r-- | spec/frontend/diffs/components/diff_view_spec.js | 16 |
2 files changed, 3 insertions, 24 deletions
diff --git a/spec/frontend/diffs/components/diff_expansion_cell_spec.js b/spec/frontend/diffs/components/diff_expansion_cell_spec.js index bd538996349..5ff0728b358 100644 --- a/spec/frontend/diffs/components/diff_expansion_cell_spec.js +++ b/spec/frontend/diffs/components/diff_expansion_cell_spec.js @@ -1,4 +1,3 @@ -import { getByText } from '@testing-library/dom'; import { mount } from '@vue/test-utils'; import { cloneDeep } from 'lodash'; import DiffExpansionCell from '~/diffs/components/diff_expansion_cell.vue'; @@ -81,7 +80,7 @@ describe('DiffExpansionCell', () => { const findExpandUp = (wrapper) => wrapper.find(EXPAND_UP_CLASS); const findExpandDown = (wrapper) => wrapper.find(EXPAND_DOWN_CLASS); - const findExpandAll = ({ element }) => getByText(element, 'Show all unchanged lines'); + const findExpandAll = (wrapper) => wrapper.find('.js-unfold-all'); describe('top row', () => { it('should have "expand up" and "show all" option', () => { @@ -90,9 +89,7 @@ describe('DiffExpansionCell', () => { }); expect(findExpandUp(wrapper).exists()).toBe(true); - expect(findExpandDown(wrapper).exists()).toBe(true); expect(findExpandUp(wrapper).attributes('disabled')).not.toBeDefined(); - expect(findExpandDown(wrapper).attributes('disabled')).toBeDefined(); expect(findExpandAll(wrapper)).not.toBe(null); }); }); @@ -114,9 +111,7 @@ describe('DiffExpansionCell', () => { }); expect(findExpandDown(wrapper).exists()).toBe(true); - expect(findExpandUp(wrapper).exists()).toBe(true); expect(findExpandDown(wrapper).attributes('disabled')).not.toBeDefined(); - expect(findExpandUp(wrapper).attributes('disabled')).toBeDefined(); expect(findExpandAll(wrapper)).not.toBe(null); }); }); @@ -144,9 +139,9 @@ describe('DiffExpansionCell', () => { newLineNumber, }); - const wrapper = createComponent({ file }); + const wrapper = createComponent({ file, lineCountBetween: 10 }); - findExpandAll(wrapper).click(); + findExpandAll(wrapper).trigger('click'); expect(store.dispatch).toHaveBeenCalledWith( 'diffs/loadMoreLines', diff --git a/spec/frontend/diffs/components/diff_view_spec.js b/spec/frontend/diffs/components/diff_view_spec.js index f982749d1de..dfbe30e460b 100644 --- a/spec/frontend/diffs/components/diff_view_spec.js +++ b/spec/frontend/diffs/components/diff_view_spec.js @@ -49,22 +49,6 @@ describe('DiffView', () => { return shallowMount(DiffView, { propsData, store, stubs }); }; - it('renders a match line', () => { - const wrapper = createWrapper({ - diffLines: [ - { - isMatchLineLeft: true, - left: { - rich_text: '@@ -4,12 +4,12 @@ import createFlash from '~/flash';', - lineDraft: {}, - }, - }, - ], - }); - expect(wrapper.find(DiffExpansionCell).exists()).toBe(true); - expect(wrapper.text()).toContain("@@ -4,12 +4,12 @@ import createFlash from '~/flash';"); - }); - it.each` type | side | container | sides | total ${'parallel'} | ${'left'} | ${'.old'} | ${{ left: { lineDraft: {}, renderDiscussion: true }, right: { lineDraft: {}, renderDiscussion: true } }} | ${2} |