diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/frontend/diffs/components/app_spec.js | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/frontend/diffs/components/app_spec.js')
-rw-r--r-- | spec/frontend/diffs/components/app_spec.js | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/spec/frontend/diffs/components/app_spec.js b/spec/frontend/diffs/components/app_spec.js index 96f2ac1692c..b88206c3b9a 100644 --- a/spec/frontend/diffs/components/app_spec.js +++ b/spec/frontend/diffs/components/app_spec.js @@ -30,7 +30,7 @@ const UPDATED_COMMIT_URL = `${TEST_HOST}/COMMIT/NEW`; Vue.use(Vuex); function getCollapsedFilesWarning(wrapper) { - return wrapper.find(CollapsedFilesWarning); + return wrapper.findComponent(CollapsedFilesWarning); } describe('diffs/components/app', () => { @@ -167,7 +167,7 @@ describe('diffs/components/app', () => { state.diffs.isLoading = true; }); - expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); }); it('displays loading icon on batch loading', () => { @@ -175,13 +175,13 @@ describe('diffs/components/app', () => { state.diffs.batchLoadingState = 'loading'; }); - expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); }); it('displays diffs container when not loading', () => { createComponent(); - expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(false); expect(wrapper.find('#diffs').exists()).toBe(true); }); @@ -263,7 +263,7 @@ describe('diffs/components/app', () => { it('renders empty state when no diff files exist', () => { createComponent(); - expect(wrapper.find(NoChanges).exists()).toBe(true); + expect(wrapper.findComponent(NoChanges).exists()).toBe(true); }); it('does not render empty state when diff files exist', () => { @@ -273,8 +273,8 @@ describe('diffs/components/app', () => { }); }); - expect(wrapper.find(NoChanges).exists()).toBe(false); - expect(wrapper.findAll(DiffFile).length).toBe(1); + expect(wrapper.findComponent(NoChanges).exists()).toBe(false); + expect(wrapper.findAllComponents(DiffFile).length).toBe(1); }); }); @@ -487,8 +487,8 @@ describe('diffs/components/app', () => { state.diffs.mergeRequestDiff = mergeRequestDiff; }); - expect(wrapper.find(CompareVersions).exists()).toBe(true); - expect(wrapper.find(CompareVersions).props()).toEqual( + expect(wrapper.findComponent(CompareVersions).exists()).toBe(true); + expect(wrapper.findComponent(CompareVersions).props()).toEqual( expect.objectContaining({ diffFilesCountText: null, }), @@ -506,8 +506,8 @@ describe('diffs/components/app', () => { state.diffs.size = 1; }); - expect(wrapper.find(HiddenFilesWarning).exists()).toBe(true); - expect(wrapper.find(HiddenFilesWarning).props()).toEqual( + expect(wrapper.findComponent(HiddenFilesWarning).exists()).toBe(true); + expect(wrapper.findComponent(HiddenFilesWarning).props()).toEqual( expect.objectContaining({ total: '5', plainDiffPath: 'plain diff path', @@ -547,7 +547,7 @@ describe('diffs/components/app', () => { }; }); - expect(wrapper.find(CommitWidget).exists()).toBe(true); + expect(wrapper.findComponent(CommitWidget).exists()).toBe(true); }); it('should display diff file if there are diff files', () => { @@ -555,13 +555,13 @@ describe('diffs/components/app', () => { state.diffs.diffFiles.push({ sha: '123' }); }); - expect(wrapper.find(DiffFile).exists()).toBe(true); + expect(wrapper.findComponent(DiffFile).exists()).toBe(true); }); it("doesn't render tree list when no changes exist", () => { createComponent(); - expect(wrapper.find(TreeList).exists()).toBe(false); + expect(wrapper.findComponent(TreeList).exists()).toBe(false); }); it('should render tree list', () => { @@ -569,7 +569,7 @@ describe('diffs/components/app', () => { state.diffs.diffFiles = [{ file_hash: '111', file_path: '111.js' }]; }); - expect(wrapper.find(TreeList).exists()).toBe(true); + expect(wrapper.findComponent(TreeList).exists()).toBe(true); }); }); @@ -636,12 +636,12 @@ describe('diffs/components/app', () => { await nextTick(); - expect(wrapper.findAll(DiffFile).length).toBe(1); + expect(wrapper.findAllComponents(DiffFile).length).toBe(1); }); describe('pagination', () => { const fileByFileNav = () => wrapper.find('[data-testid="file-by-file-navigation"]'); - const paginator = () => fileByFileNav().find(GlPagination); + const paginator = () => fileByFileNav().findComponent(GlPagination); it('sets previous button as disabled', async () => { createComponent({ fileByFileUserPreference: true }, ({ state }) => { @@ -682,7 +682,7 @@ describe('diffs/components/app', () => { ${'123'} | ${2} ${'312'} | ${1} `( - 'it calls navigateToDiffFileIndex with $index when $link is clicked', + 'calls navigateToDiffFileIndex with $index when $link is clicked', async ({ currentDiffFileId, targetFile }) => { createComponent({ fileByFileUserPreference: true }, ({ state }) => { state.diffs.diffFiles.push({ file_hash: '123' }, { file_hash: '312' }); |