diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-18 00:13:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-18 00:13:54 +0300 |
commit | c766b837cfcba1a652b781f1f725ae034c9755e1 (patch) | |
tree | a97ee56aa9ce37e51e5b5d40f586bed2ed4647a7 /spec/frontend | |
parent | 5cbf24858edb03505b16474e3b7b41a49b677ff6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
4 files changed, 32 insertions, 34 deletions
diff --git a/spec/frontend/admin/abuse_report/components/user_details_spec.js b/spec/frontend/admin/abuse_report/components/user_details_spec.js index f3d8d5bb610..24ec0cdb1b2 100644 --- a/spec/frontend/admin/abuse_report/components/user_details_spec.js +++ b/spec/frontend/admin/abuse_report/components/user_details_spec.js @@ -70,14 +70,6 @@ describe('UserDetails', () => { expect(findUserDetailLabel('credit-card-verification')).toBe(USER_DETAILS_I18N.creditCard); }); - it('renders the users name', () => { - expect(findUserDetail('credit-card-verification').text()).toContain( - sprintf(USER_DETAILS_I18N.registeredWith, { ...user.creditCard }), - ); - - expect(findUserDetail('credit-card-verification').text()).toContain(user.creditCard.name); - }); - describe('similar credit cards', () => { it('renders the number of similar records', () => { expect(findUserDetail('credit-card-verification').text()).toContain( diff --git a/spec/frontend/projects/settings/components/new_access_dropdown_spec.js b/spec/frontend/projects/settings/components/new_access_dropdown_spec.js index 0ed2e51e8c3..7c8cc1bb38d 100644 --- a/spec/frontend/projects/settings/components/new_access_dropdown_spec.js +++ b/spec/frontend/projects/settings/components/new_access_dropdown_spec.js @@ -14,11 +14,13 @@ import AccessDropdown, { i18n } from '~/projects/settings/components/access_drop import { ACCESS_LEVELS, LEVEL_TYPES } from '~/projects/settings/constants'; jest.mock('~/projects/settings/api/access_dropdown_api', () => ({ - getGroups: jest.fn().mockResolvedValue([ - { id: 4, name: 'group4' }, - { id: 5, name: 'group5' }, - { id: 6, name: 'group6' }, - ]), + getGroups: jest.fn().mockResolvedValue({ + data: [ + { id: 4, name: 'group4' }, + { id: 5, name: 'group5' }, + { id: 6, name: 'group6' }, + ], + }), getUsers: jest.fn().mockResolvedValue({ data: [ { id: 7, name: 'user7' }, diff --git a/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js b/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js index 46a1c18f16f..b4c90fe49d1 100644 --- a/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js +++ b/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js @@ -7,6 +7,8 @@ import { EDITING_MODE_MARKDOWN_FIELD, EDITING_MODE_CONTENT_EDITOR, CLEAR_AUTOSAVE_ENTRY_EVENT, + CONTENT_EDITOR_READY_EVENT, + MARKDOWN_EDITOR_READY_EVENT, } from '~/vue_shared/constants'; import markdownEditorEventHub from '~/vue_shared/components/markdown/eventhub'; import MarkdownEditor from '~/vue_shared/components/markdown/markdown_editor.vue'; @@ -83,22 +85,23 @@ describe('vue_shared/component/markdown/markdown_editor', () => { const findLocalStorageSync = () => wrapper.findComponent(LocalStorageSync); const findContentEditor = () => { const result = wrapper.findComponent(ContentEditor); - // In Vue.js 3 there are nuances stubbing component with custom stub on mount // So we try to search for stub also return result.exists() ? result : wrapper.findComponent(ContentEditorStub); }; - const enableContentEditor = async () => { - findMarkdownField().vm.$emit('enableContentEditor'); - await nextTick(); - await waitForPromises(); + const enableContentEditor = () => { + return new Promise((resolve) => { + markdownEditorEventHub.$once(CONTENT_EDITOR_READY_EVENT, resolve); + findMarkdownField().vm.$emit('enableContentEditor'); + }); }; - const enableMarkdownEditor = async () => { - findContentEditor().vm.$emit('enableMarkdownEditor'); - await nextTick(); - await waitForPromises(); + const enableMarkdownEditor = () => { + return new Promise((resolve) => { + markdownEditorEventHub.$once(MARKDOWN_EDITOR_READY_EVENT, resolve); + findContentEditor().vm.$emit('enableMarkdownEditor'); + }); }; beforeEach(() => { @@ -128,9 +131,7 @@ describe('vue_shared/component/markdown/markdown_editor', () => { }); }); - // quarantine: https://gitlab.com/gitlab-org/gitlab/-/issues/412618 - // eslint-disable-next-line jest/no-disabled-tests - it.skip('passes render_quick_actions param to renderMarkdownPath if quick actions are enabled', async () => { + it('passes render_quick_actions param to renderMarkdownPath if quick actions are enabled', async () => { buildWrapper({ propsData: { supportsQuickActions: true } }); await enableContentEditor(); @@ -139,9 +140,7 @@ describe('vue_shared/component/markdown/markdown_editor', () => { expect(mock.history.post[0].url).toContain(`render_quick_actions=true`); }); - // quarantine: https://gitlab.com/gitlab-org/gitlab/-/issues/411565 - // eslint-disable-next-line jest/no-disabled-tests - it.skip('does not pass render_quick_actions param to renderMarkdownPath if quick actions are disabled', async () => { + it('does not pass render_quick_actions param to renderMarkdownPath if quick actions are disabled', async () => { buildWrapper({ propsData: { supportsQuickActions: false } }); await enableContentEditor(); @@ -213,9 +212,7 @@ describe('vue_shared/component/markdown/markdown_editor', () => { expect(findMarkdownField().find('textarea').attributes('disabled')).toBe(undefined); }); - // quarantine: https://gitlab.com/gitlab-org/gitlab/-/issues/404734 - // eslint-disable-next-line jest/no-disabled-tests - it.skip('disables content editor when disabled prop is true', async () => { + it('disables content editor when disabled prop is true', async () => { buildWrapper({ propsData: { disabled: true } }); await enableContentEditor(); @@ -358,9 +355,7 @@ describe('vue_shared/component/markdown/markdown_editor', () => { }); it(`emits ${EDITING_MODE_MARKDOWN_FIELD} event when enableMarkdownEditor emitted from content editor`, async () => { - buildWrapper({ - stubs: { ContentEditor: ContentEditorStub }, - }); + buildWrapper(); await enableContentEditor(); await enableMarkdownEditor(); diff --git a/spec/frontend/work_items/mock_data.js b/spec/frontend/work_items/mock_data.js index fc405f626c6..bd210a03b21 100644 --- a/spec/frontend/work_items/mock_data.js +++ b/spec/frontend/work_items/mock_data.js @@ -194,6 +194,7 @@ export const workItemQueryResponse = { confidential: false, title: '123', state: 'OPEN', + webUrl: '/gitlab-org/gitlab-test/-/work_items/4', workItemType: { id: '1', name: 'Task', @@ -271,6 +272,7 @@ export const updateWorkItemMutationResponse = { confidential: false, title: '123', state: 'OPEN', + webUrl: '/gitlab-org/gitlab-test/-/work_items/4', workItemType: { id: '1', name: 'Task', @@ -381,6 +383,7 @@ export const convertWorkItemMutationResponse = { confidential: false, title: '123', state: 'OPEN', + webUrl: '/gitlab-org/gitlab-test/-/work_items/4', workItemType: { id: '1', name: 'Task', @@ -765,6 +768,7 @@ export const workItemResponseFactory = ({ confidential: false, title: '123', state: 'OPEN', + webUrl: '/gitlab-org/gitlab-test/-/work_items/5', workItemType: { id: '1', name: 'Task', @@ -1092,6 +1096,7 @@ export const workItemHierarchyNoUpdatePermissionResponse = { confidential: false, createdAt: '2022-08-03T12:41:54Z', closedAt: null, + webUrl: '/gitlab-org/gitlab-test/-/work_items/2', widgets: [ { type: 'HIERARCHY', @@ -1144,6 +1149,7 @@ export const confidentialWorkItemTask = { confidential: true, createdAt: '2022-08-03T12:41:54Z', closedAt: null, + webUrl: '/gitlab-org/gitlab-test/-/work_items/2', widgets: [], __typename: 'WorkItem', }; @@ -1162,6 +1168,7 @@ export const closedWorkItemTask = { confidential: false, createdAt: '2022-08-03T12:41:54Z', closedAt: '2022-08-12T13:07:52Z', + webUrl: '/gitlab-org/gitlab-test/-/work_items/3', widgets: [], __typename: 'WorkItem', }; @@ -1184,6 +1191,7 @@ export const childrenWorkItems = [ confidential: false, createdAt: '2022-08-03T12:41:54Z', closedAt: null, + webUrl: '/gitlab-org/gitlab-test/-/work_items/5', widgets: [], __typename: 'WorkItem', }, @@ -1422,6 +1430,7 @@ export const workItemHierarchyTreeResponse = { confidential: false, createdAt: '2022-08-03T12:41:54Z', closedAt: null, + webUrl: '/gitlab-org/gitlab-test/-/work_items/13', widgets: [ { type: 'HIERARCHY', |