diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-21 18:14:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-21 18:14:09 +0300 |
commit | e87220d9c1a7878a4cb2bb86554c5951371e340b (patch) | |
tree | fa8d81c8463cf97362f441f81dfef890df34ebbd /spec/frontend/snippets | |
parent | c0a3d287c0d613cc439a31683d06dd70f3411f8c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/snippets')
7 files changed, 29 insertions, 29 deletions
diff --git a/spec/frontend/snippets/components/edit_spec.js b/spec/frontend/snippets/components/edit_spec.js index cf897414ccb..ea9d696599d 100644 --- a/spec/frontend/snippets/components/edit_spec.js +++ b/spec/frontend/snippets/components/edit_spec.js @@ -206,7 +206,7 @@ describe('Snippet Edit app', () => { }); it('should hide loader', () => { - expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(false); }); }); @@ -237,7 +237,7 @@ describe('Snippet Edit app', () => { !titleHasErrors, ); - expect(wrapper.find(SnippetBlobActionsEdit).props('isValid')).toEqual( + expect(wrapper.findComponent(SnippetBlobActionsEdit).props('isValid')).toEqual( !blobActionsHasErrors, ); }, @@ -273,7 +273,7 @@ describe('Snippet Edit app', () => { selectedLevel: visibility, }); - expect(wrapper.find(SnippetVisibilityEdit).props('value')).toBe(visibility); + expect(wrapper.findComponent(SnippetVisibilityEdit).props('value')).toBe(visibility); }); describe('form submission handling', () => { diff --git a/spec/frontend/snippets/components/embed_dropdown_spec.js b/spec/frontend/snippets/components/embed_dropdown_spec.js index 389b1c618a3..ed5ea6cab8a 100644 --- a/spec/frontend/snippets/components/embed_dropdown_spec.js +++ b/spec/frontend/snippets/components/embed_dropdown_spec.js @@ -36,7 +36,7 @@ describe('snippets/components/embed_dropdown', () => { sections.push(current); } else { - const value = x.find(GlFormInputGroup).props('value'); + const value = x.findComponent(GlFormInputGroup).props('value'); const copyValue = x.find('button[title="Copy"]').attributes('data-clipboard-text'); Object.assign(current, { diff --git a/spec/frontend/snippets/components/snippet_blob_edit_spec.js b/spec/frontend/snippets/components/snippet_blob_edit_spec.js index 7ea27864519..f5f86167f2b 100644 --- a/spec/frontend/snippets/components/snippet_blob_edit_spec.js +++ b/spec/frontend/snippets/components/snippet_blob_edit_spec.js @@ -46,9 +46,9 @@ describe('Snippet Blob Edit component', () => { }); }; - const findLoadingIcon = () => wrapper.find(GlLoadingIcon); - const findHeader = () => wrapper.find(BlobHeaderEdit); - const findContent = () => wrapper.find(SourceEditor); + const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon); + const findHeader = () => wrapper.findComponent(BlobHeaderEdit); + const findContent = () => wrapper.findComponent(SourceEditor); const getLastUpdatedArgs = () => { const event = wrapper.emitted()['blob-updated']; diff --git a/spec/frontend/snippets/components/snippet_blob_view_spec.js b/spec/frontend/snippets/components/snippet_blob_view_spec.js index aa31377f390..74671c3fc1d 100644 --- a/spec/frontend/snippets/components/snippet_blob_view_spec.js +++ b/spec/frontend/snippets/components/snippet_blob_view_spec.js @@ -69,13 +69,13 @@ describe('Blob Embeddable', () => { describe('rendering', () => { it('renders correct components', () => { createComponent(); - expect(wrapper.find(BlobHeader).exists()).toBe(true); - expect(wrapper.find(BlobContent).exists()).toBe(true); + expect(wrapper.findComponent(BlobHeader).exists()).toBe(true); + expect(wrapper.findComponent(BlobContent).exists()).toBe(true); }); it('sets simple viewer correctly', () => { createComponent(); - expect(wrapper.find(SimpleViewer).exists()).toBe(true); + expect(wrapper.findComponent(SimpleViewer).exists()).toBe(true); }); it('sets rich viewer correctly', () => { @@ -83,20 +83,20 @@ describe('Blob Embeddable', () => { createComponent({ data, }); - expect(wrapper.find(RichViewer).exists()).toBe(true); + expect(wrapper.findComponent(RichViewer).exists()).toBe(true); }); it('correctly switches viewer type', async () => { createComponent(); - expect(wrapper.find(SimpleViewer).exists()).toBe(true); + expect(wrapper.findComponent(SimpleViewer).exists()).toBe(true); wrapper.vm.switchViewer(RichViewerMock.type); await nextTick(); - expect(wrapper.find(RichViewer).exists()).toBe(true); + expect(wrapper.findComponent(RichViewer).exists()).toBe(true); await wrapper.vm.switchViewer(SimpleViewerMock.type); - expect(wrapper.find(SimpleViewer).exists()).toBe(true); + expect(wrapper.findComponent(SimpleViewer).exists()).toBe(true); }); it('passes information about render error down to blob header', () => { @@ -110,7 +110,7 @@ describe('Blob Embeddable', () => { }, }); - expect(wrapper.find(BlobHeader).props('hasRenderError')).toBe(true); + expect(wrapper.findComponent(BlobHeader).props('hasRenderError')).toBe(true); }); describe('bob content in multi-file scenario', () => { @@ -161,7 +161,7 @@ describe('Blob Embeddable', () => { await nextTick(); - const findContent = () => wrapper.find(BlobContent); + const findContent = () => wrapper.findComponent(BlobContent); expect(findContent().props('content')).toBe(expectedContent); }, @@ -183,7 +183,7 @@ describe('Blob Embeddable', () => { }); expect(wrapper.vm.activeViewerType).toBe(SimpleViewerMock.type); - expect(wrapper.find(SimpleViewer).exists()).toBe(true); + expect(wrapper.findComponent(SimpleViewer).exists()).toBe(true); }); describe('switchViewer()', () => { @@ -194,11 +194,11 @@ describe('Blob Embeddable', () => { await nextTick(); expect(wrapper.vm.activeViewerType).toBe(RichViewerMock.type); - expect(wrapper.find(RichViewer).exists()).toBe(true); + expect(wrapper.findComponent(RichViewer).exists()).toBe(true); await wrapper.vm.switchViewer(SimpleViewerMock.type); expect(wrapper.vm.activeViewerType).toBe(SimpleViewerMock.type); - expect(wrapper.find(SimpleViewer).exists()).toBe(true); + expect(wrapper.findComponent(SimpleViewer).exists()).toBe(true); }); }); }); @@ -206,7 +206,7 @@ describe('Blob Embeddable', () => { describe('functionality', () => { describe('render error', () => { - const findContentEl = () => wrapper.find(BlobContent); + const findContentEl = () => wrapper.findComponent(BlobContent); it('correctly sets blob on the blob-content-error component', () => { createComponent(); diff --git a/spec/frontend/snippets/components/snippet_header_spec.js b/spec/frontend/snippets/components/snippet_header_spec.js index b750225a383..3d64839a408 100644 --- a/spec/frontend/snippets/components/snippet_header_spec.js +++ b/spec/frontend/snippets/components/snippet_header_spec.js @@ -311,7 +311,7 @@ describe('Snippet header component', () => { it('renders modal for deletion of a snippet', () => { createComponent(); - expect(wrapper.find(GlModal).exists()).toBe(true); + expect(wrapper.findComponent(GlModal).exists()).toBe(true); }); it.each` diff --git a/spec/frontend/snippets/components/snippet_title_spec.js b/spec/frontend/snippets/components/snippet_title_spec.js index 48fb51ce703..7c40735d64e 100644 --- a/spec/frontend/snippets/components/snippet_title_spec.js +++ b/spec/frontend/snippets/components/snippet_title_spec.js @@ -39,12 +39,12 @@ describe('Snippet header component', () => { createComponent(); expect(wrapper.text().trim()).toContain(title); - expect(wrapper.find(SnippetDescription).props('description')).toBe(descriptionHtml); + expect(wrapper.findComponent(SnippetDescription).props('description')).toBe(descriptionHtml); }); it('does not render recent changes time stamp if there were no updates', () => { createComponent(); - expect(wrapper.find(GlSprintf).exists()).toBe(false); + expect(wrapper.findComponent(GlSprintf).exists()).toBe(false); }); it('does not render recent changes time stamp if the time for creation and updates match', () => { @@ -57,7 +57,7 @@ describe('Snippet header component', () => { }); createComponent({ props }); - expect(wrapper.find(GlSprintf).exists()).toBe(false); + expect(wrapper.findComponent(GlSprintf).exists()).toBe(false); }); it('renders translated string with most recent changes timestamp if changes were made', () => { @@ -70,6 +70,6 @@ describe('Snippet header component', () => { }); createComponent({ props }); - expect(wrapper.find(GlSprintf).exists()).toBe(true); + expect(wrapper.findComponent(GlSprintf).exists()).toBe(true); }); }); diff --git a/spec/frontend/snippets/components/snippet_visibility_edit_spec.js b/spec/frontend/snippets/components/snippet_visibility_edit_spec.js index 2d043a5caba..29eb002ef4a 100644 --- a/spec/frontend/snippets/components/snippet_visibility_edit_spec.js +++ b/spec/frontend/snippets/components/snippet_visibility_edit_spec.js @@ -39,13 +39,13 @@ describe('Snippet Visibility Edit component', () => { }); } - const findLink = () => wrapper.find('label').find(GlLink); - const findRadios = () => wrapper.find(GlFormRadioGroup).findAllComponents(GlFormRadio); + const findLink = () => wrapper.find('label').findComponent(GlLink); + const findRadios = () => wrapper.findComponent(GlFormRadioGroup).findAllComponents(GlFormRadio); const findRadiosData = () => findRadios().wrappers.map((x) => { return { value: x.find('input').attributes('value'), - icon: x.find(GlIcon).props('name'), + icon: x.findComponent(GlIcon).props('name'), description: x.find('.help-text').text(), text: x.find('.js-visibility-option').text(), }; @@ -147,7 +147,7 @@ describe('Snippet Visibility Edit component', () => { createComponent({ propsData: { value } }); - expect(wrapper.find(GlFormRadioGroup).attributes('checked')).toBe(value); + expect(wrapper.findComponent(GlFormRadioGroup).attributes('checked')).toBe(value); }); }); }); |