diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-11 21:11:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-11 21:11:57 +0300 |
commit | 603ee53dbdbd3adaced752e1a119eb40d64e9979 (patch) | |
tree | 7c3e912fe4c02ea464063a4a224b02bbcdeea580 /spec/frontend | |
parent | c79523e3952dad31a9ab8ccbb9e38466fec3aec3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
15 files changed, 37 insertions, 35 deletions
diff --git a/spec/frontend/boards/components/board_new_item_spec.js b/spec/frontend/boards/components/board_new_item_spec.js index 86cebc8a719..dc6581e9360 100644 --- a/spec/frontend/boards/components/board_new_item_spec.js +++ b/spec/frontend/boards/components/board_new_item_spec.js @@ -93,7 +93,7 @@ describe('BoardNewItem', () => { titleInput().setValue('Foo'); await glForm().trigger('submit'); - expect(wrapper.emitted('form-submit')).toBeTruthy(); + expect(wrapper.emitted('form-submit')).toHaveLength(1); expect(wrapper.emitted('form-submit')[0]).toEqual([ { title: 'Foo', @@ -131,7 +131,7 @@ describe('BoardNewItem', () => { await glForm().trigger('reset'); expect(titleInput().element.value).toBe(''); - expect(wrapper.emitted('form-cancel')).toBeTruthy(); + expect(wrapper.emitted('form-cancel')).toHaveLength(1); }); }); }); diff --git a/spec/frontend/clusters/agents/components/activity_history_item_spec.js b/spec/frontend/clusters/agents/components/activity_history_item_spec.js index 100a280d0cc..68f6f11aa8f 100644 --- a/spec/frontend/clusters/agents/components/activity_history_item_spec.js +++ b/spec/frontend/clusters/agents/components/activity_history_item_spec.js @@ -23,7 +23,7 @@ describe('ActivityHistoryItem', () => { }; const findHistoryItem = () => wrapper.findComponent(HistoryItem); - const findTimeAgo = () => wrapper.find(TimeAgoTooltip); + const findTimeAgo = () => wrapper.findComponent(TimeAgoTooltip); afterEach(() => { wrapper.destroy(); diff --git a/spec/frontend/clusters/agents/components/create_token_modal_spec.js b/spec/frontend/clusters/agents/components/create_token_modal_spec.js index ad48afe10b6..0d10801e80e 100644 --- a/spec/frontend/clusters/agents/components/create_token_modal_spec.js +++ b/spec/frontend/clusters/agents/components/create_token_modal_spec.js @@ -55,7 +55,7 @@ describe('CreateTokenModal', () => { const findAgentInstructions = () => findModal().findComponent(AgentToken); const findButtonByVariant = (variant) => findModal() - .findAll(GlButton) + .findAllComponents(GlButton) .wrappers.find((button) => button.props('variant') === variant); const findActionButton = () => findButtonByVariant('confirm'); const findCancelButton = () => wrapper.findByTestId('agent-token-close-button'); diff --git a/spec/frontend/clusters/agents/components/token_table_spec.js b/spec/frontend/clusters/agents/components/token_table_spec.js index 6caeaf5c192..334615f1818 100644 --- a/spec/frontend/clusters/agents/components/token_table_spec.js +++ b/spec/frontend/clusters/agents/components/token_table_spec.js @@ -136,8 +136,8 @@ describe('ClusterAgentTokenTable', () => { const token = tokens.at(lineNumber); expect(token.text()).toContain(description); - expect(token.find(GlTruncate).exists()).toBe(truncatesText); - expect(token.find(GlTooltip).exists()).toBe(hasTooltip); + expect(token.findComponent(GlTruncate).exists()).toBe(truncatesText); + expect(token.findComponent(GlTooltip).exists()).toBe(hasTooltip); }, ); diff --git a/spec/frontend/clusters/components/new_cluster_spec.js b/spec/frontend/clusters/components/new_cluster_spec.js index f9df70b9f87..ef39c90aaef 100644 --- a/spec/frontend/clusters/components/new_cluster_spec.js +++ b/spec/frontend/clusters/components/new_cluster_spec.js @@ -12,9 +12,9 @@ describe('NewCluster', () => { await nextTick(); }; - const findDescription = () => wrapper.find(GlSprintf); + const findDescription = () => wrapper.findComponent(GlSprintf); - const findLink = () => wrapper.find(GlLink); + const findLink = () => wrapper.findComponent(GlLink); beforeEach(() => { return createWrapper(); diff --git a/spec/frontend/clusters/forms/components/integration_form_spec.js b/spec/frontend/clusters/forms/components/integration_form_spec.js index 67d442bfdc5..b17886a5826 100644 --- a/spec/frontend/clusters/forms/components/integration_form_spec.js +++ b/spec/frontend/clusters/forms/components/integration_form_spec.js @@ -32,8 +32,8 @@ describe('ClusterIntegrationForm', () => { wrapper = null; }; - const findSubmitButton = () => wrapper.find(GlButton); - const findGlToggle = () => wrapper.find(GlToggle); + const findSubmitButton = () => wrapper.findComponent(GlButton); + const findGlToggle = () => wrapper.findComponent(GlToggle); afterEach(() => { destroyWrapper(); diff --git a/spec/frontend/diffs/store/utils_spec.js b/spec/frontend/diffs/store/utils_spec.js index 8852c6c62c5..3f870a98396 100644 --- a/spec/frontend/diffs/store/utils_spec.js +++ b/spec/frontend/diffs/store/utils_spec.js @@ -424,8 +424,8 @@ describe('DiffsStoreUtils', () => { expect(firstChar).not.toBe('+'); expect(firstChar).not.toBe('-'); - expect(preparedDiff.diff_files[0].renderIt).toBeTruthy(); - expect(preparedDiff.diff_files[0].collapsed).toBeFalsy(); + expect(preparedDiff.diff_files[0].renderIt).toBe(true); + expect(preparedDiff.diff_files[0].collapsed).toBe(false); }); it('guarantees an empty array for both diff styles', () => { @@ -506,8 +506,8 @@ describe('DiffsStoreUtils', () => { }); it('sets the renderIt and collapsed attribute on files', () => { - expect(preparedDiffFiles[0].renderIt).toBeTruthy(); - expect(preparedDiffFiles[0].collapsed).toBeFalsy(); + expect(preparedDiffFiles[0].renderIt).toBe(true); + expect(preparedDiffFiles[0].collapsed).toBeUndefined(); }); it('guarantees an empty array of lines for both diff styles', () => { diff --git a/spec/frontend/dropzone_input_spec.js b/spec/frontend/dropzone_input_spec.js index a633de9ef56..0fe70bac6b7 100644 --- a/spec/frontend/dropzone_input_spec.js +++ b/spec/frontend/dropzone_input_spec.js @@ -29,7 +29,9 @@ describe('dropzone_input', () => { it('returns valid dropzone when successfully initialize', () => { const dropzone = dropzoneInput($(TEMPLATE)); - expect(dropzone.version).toBeTruthy(); + expect(dropzone).toMatchObject({ + version: expect.any(String), + }); }); describe('handlePaste', () => { diff --git a/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js b/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js index 1ba5a505f57..b44af547658 100644 --- a/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js +++ b/spec/frontend/error_tracking_settings/components/project_dropdown_spec.js @@ -41,23 +41,23 @@ describe('error tracking settings project dropdown', () => { describe('empty project list', () => { it('renders the dropdown', () => { - expect(wrapper.find('#project-dropdown').exists()).toBeTruthy(); - expect(wrapper.find(GlDropdown).exists()).toBeTruthy(); + expect(wrapper.find('#project-dropdown').exists()).toBe(true); + expect(wrapper.find(GlDropdown).exists()).toBe(true); }); it('shows helper text', () => { - expect(wrapper.find('.js-project-dropdown-label').exists()).toBeTruthy(); + expect(wrapper.find('.js-project-dropdown-label').exists()).toBe(true); expect(wrapper.find('.js-project-dropdown-label').text()).toContain( 'To enable project selection', ); }); it('does not show an error', () => { - expect(wrapper.find('.js-project-dropdown-error').exists()).toBeFalsy(); + expect(wrapper.find('.js-project-dropdown-error').exists()).toBe(false); }); it('does not contain any dropdown items', () => { - expect(wrapper.find(GlDropdownItem).exists()).toBeFalsy(); + expect(wrapper.find(GlDropdownItem).exists()).toBe(false); expect(wrapper.find(GlDropdown).props('text')).toBe('No projects available'); }); }); @@ -70,12 +70,12 @@ describe('error tracking settings project dropdown', () => { }); it('renders the dropdown', () => { - expect(wrapper.find('#project-dropdown').exists()).toBeTruthy(); - expect(wrapper.find(GlDropdown).exists()).toBeTruthy(); + expect(wrapper.find('#project-dropdown').exists()).toBe(true); + expect(wrapper.find(GlDropdown).exists()).toBe(true); }); it('contains a number of dropdown items', () => { - expect(wrapper.find(GlDropdownItem).exists()).toBeTruthy(); + expect(wrapper.find(GlDropdownItem).exists()).toBe(true); expect(wrapper.findAll(GlDropdownItem).length).toBe(2); }); }); @@ -89,8 +89,8 @@ describe('error tracking settings project dropdown', () => { }); it('does not show helper text', () => { - expect(wrapper.find('.js-project-dropdown-label').exists()).toBeFalsy(); - expect(wrapper.find('.js-project-dropdown-error').exists()).toBeFalsy(); + expect(wrapper.find('.js-project-dropdown-label').exists()).toBe(false); + expect(wrapper.find('.js-project-dropdown-error').exists()).toBe(false); }); }); @@ -105,8 +105,8 @@ describe('error tracking settings project dropdown', () => { }); it('displays a error', () => { - expect(wrapper.find('.js-project-dropdown-label').exists()).toBeFalsy(); - expect(wrapper.find('.js-project-dropdown-error').exists()).toBeTruthy(); + expect(wrapper.find('.js-project-dropdown-label').exists()).toBe(false); + expect(wrapper.find('.js-project-dropdown-error').exists()).toBe(true); }); }); }); diff --git a/spec/frontend/ide/stores/actions/tree_spec.js b/spec/frontend/ide/stores/actions/tree_spec.js index d43393875eb..6e8a03b47ad 100644 --- a/spec/frontend/ide/stores/actions/tree_spec.js +++ b/spec/frontend/ide/stores/actions/tree_spec.js @@ -134,7 +134,7 @@ describe('Multi-file store tree actions', () => { it('toggles the tree open', async () => { await store.dispatch('toggleTreeOpen', tree.path); - expect(tree.opened).toBeTruthy(); + expect(tree.opened).toBe(true); }); }); diff --git a/spec/frontend/ide/stores/mutations/merge_request_spec.js b/spec/frontend/ide/stores/mutations/merge_request_spec.js index afbe6770c0d..2af06835181 100644 --- a/spec/frontend/ide/stores/mutations/merge_request_spec.js +++ b/spec/frontend/ide/stores/mutations/merge_request_spec.js @@ -30,7 +30,7 @@ describe('IDE store merge request mutations', () => { const newMr = localState.projects.abcproject.mergeRequests[1]; expect(newMr.title).toBe('mr'); - expect(newMr.active).toBeTruthy(); + expect(newMr.active).toBe(true); }); it('keeps original data', () => { diff --git a/spec/frontend/issuable/related_issues/components/add_issuable_form_spec.js b/spec/frontend/issuable/related_issues/components/add_issuable_form_spec.js index ce98a16dbb7..16d4459f597 100644 --- a/spec/frontend/issuable/related_issues/components/add_issuable_form_spec.js +++ b/spec/frontend/issuable/related_issues/components/add_issuable_form_spec.js @@ -157,8 +157,8 @@ describe('AddIssuableForm', () => { describe('categorized issuables', () => { it.each` issuableType | pathIdSeparator | contextHeader | contextFooter - ${issuableTypesMap.ISSUE} | ${PathIdSeparator.Issue} | ${'The current issue'} | ${'the following issue(s)'} - ${issuableTypesMap.EPIC} | ${PathIdSeparator.Epic} | ${'The current epic'} | ${'the following epic(s)'} + ${issuableTypesMap.ISSUE} | ${PathIdSeparator.Issue} | ${'The current issue'} | ${'the following issues'} + ${issuableTypesMap.EPIC} | ${PathIdSeparator.Epic} | ${'The current epic'} | ${'the following epics'} `( 'show header text as "$contextHeader" and footer text as "$contextFooter" issuableType is set to $issuableType', ({ issuableType, contextHeader, contextFooter }) => { diff --git a/spec/frontend/sidebar/assignees_spec.js b/spec/frontend/sidebar/assignees_spec.js index a4474ead956..c2aff456abb 100644 --- a/spec/frontend/sidebar/assignees_spec.js +++ b/spec/frontend/sidebar/assignees_spec.js @@ -70,7 +70,7 @@ describe('Assignee component', () => { wrapper.find('[data-testid="assign-yourself"]').trigger('click'); await nextTick(); - expect(wrapper.emitted('assign-self')).toBeTruthy(); + expect(wrapper.emitted('assign-self')).toHaveLength(1); }); }); diff --git a/spec/frontend/vue_shared/components/markdown/header_spec.js b/spec/frontend/vue_shared/components/markdown/header_spec.js index ffc0f873377..9831908f806 100644 --- a/spec/frontend/vue_shared/components/markdown/header_spec.js +++ b/spec/frontend/vue_shared/components/markdown/header_spec.js @@ -125,8 +125,8 @@ describe('Markdown field header component', () => { ), ]); - expect(wrapper.emitted('preview-markdown')).toBeFalsy(); - expect(wrapper.emitted('write-markdown')).toBeFalsy(); + expect(wrapper.emitted('preview-markdown')).toBeUndefined(); + expect(wrapper.emitted('write-markdown')).toBeUndefined(); }); it('blurs preview link after click', () => { diff --git a/spec/frontend/vue_shared/components/metric_images/metric_images_tab_spec.js b/spec/frontend/vue_shared/components/metric_images/metric_images_tab_spec.js index 2cefa77b72d..1789610dba9 100644 --- a/spec/frontend/vue_shared/components/metric_images/metric_images_tab_spec.js +++ b/spec/frontend/vue_shared/components/metric_images/metric_images_tab_spec.js @@ -114,7 +114,7 @@ describe('Metric images tab', () => { await waitForPromises(); - expect(findModal().attributes('visible')).toBeFalsy(); + expect(findModal().attributes('visible')).toBeUndefined(); }); it('should add files and url when selected', async () => { |