diff options
Diffstat (limited to 'spec/frontend/sidebar')
12 files changed, 106 insertions, 266 deletions
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/sidebar/components/assignees/sidebar_assignees_widget_spec.js b/spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js index 5fd364afbe4..88015ed42a3 100644 --- a/spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js +++ b/spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js @@ -148,6 +148,7 @@ describe('Sidebar assignees widget', () => { expect(findAssignees().props('users')).toEqual([ { + __typename: 'UserCore', id: 'gid://gitlab/User/2', avatarUrl: 'https://www.gravatar.com/avatar/a95e5b71488f4b9d69ce5ff58bfd28d6?s=80\u0026d=identicon', diff --git a/spec/frontend/sidebar/components/attention_requested_toggle_spec.js b/spec/frontend/sidebar/components/attention_requested_toggle_spec.js deleted file mode 100644 index 58fa878a189..00000000000 --- a/spec/frontend/sidebar/components/attention_requested_toggle_spec.js +++ /dev/null @@ -1,121 +0,0 @@ -import { GlButton } from '@gitlab/ui'; -import { mount } from '@vue/test-utils'; -import AttentionRequestedToggle from '~/sidebar/components/attention_requested_toggle.vue'; - -let wrapper; - -function factory(propsData = {}) { - wrapper = mount(AttentionRequestedToggle, { propsData }); -} - -const findToggle = () => wrapper.findComponent(GlButton); - -describe('Attention require toggle', () => { - afterEach(() => { - wrapper.destroy(); - }); - - it('renders button', () => { - factory({ - type: 'reviewer', - user: { attention_requested: false, can_update_merge_request: true }, - }); - - expect(findToggle().exists()).toBe(true); - }); - - it.each` - attentionRequested | icon - ${true} | ${'attention-solid'} - ${false} | ${'attention'} - `( - 'renders $icon icon when attention_requested is $attentionRequested', - ({ attentionRequested, icon }) => { - factory({ - type: 'reviewer', - user: { attention_requested: attentionRequested, can_update_merge_request: true }, - }); - - expect(findToggle().props('icon')).toBe(icon); - }, - ); - - it.each` - attentionRequested | selected - ${true} | ${true} - ${false} | ${false} - `( - 'renders button with as selected when $selected when attention_requested is $attentionRequested', - ({ attentionRequested, selected }) => { - factory({ - type: 'reviewer', - user: { attention_requested: attentionRequested, can_update_merge_request: true }, - }); - - expect(findToggle().props('selected')).toBe(selected); - }, - ); - - it('emits toggle-attention-requested on click', async () => { - factory({ - type: 'reviewer', - user: { attention_requested: true, can_update_merge_request: true }, - }); - - await findToggle().trigger('click'); - - expect(wrapper.emitted('toggle-attention-requested')[0]).toEqual([ - { - user: { attention_requested: true, can_update_merge_request: true }, - callback: expect.anything(), - direction: 'remove', - }, - ]); - }); - - it('does not emit toggle-attention-requested on click if can_update_merge_request is false', async () => { - factory({ - type: 'reviewer', - user: { attention_requested: true, can_update_merge_request: false }, - }); - - await findToggle().trigger('click'); - - expect(wrapper.emitted('toggle-attention-requested')).toBe(undefined); - }); - - it('sets loading on click', async () => { - factory({ - type: 'reviewer', - user: { attention_requested: true, can_update_merge_request: true }, - }); - - await findToggle().trigger('click'); - - expect(findToggle().props('loading')).toBe(true); - }); - - it.each` - type | attentionRequested | tooltip | canUpdateMergeRequest - ${'reviewer'} | ${true} | ${AttentionRequestedToggle.i18n.removeAttentionRequest} | ${true} - ${'reviewer'} | ${false} | ${AttentionRequestedToggle.i18n.addAttentionRequest} | ${true} - ${'assignee'} | ${false} | ${AttentionRequestedToggle.i18n.addAttentionRequest} | ${true} - ${'reviewer'} | ${true} | ${AttentionRequestedToggle.i18n.attentionRequestedNoPermission} | ${false} - ${'reviewer'} | ${false} | ${AttentionRequestedToggle.i18n.noAttentionRequestedNoPermission} | ${false} - ${'assignee'} | ${true} | ${AttentionRequestedToggle.i18n.attentionRequestedNoPermission} | ${false} - ${'assignee'} | ${false} | ${AttentionRequestedToggle.i18n.noAttentionRequestedNoPermission} | ${false} - `( - 'sets tooltip as $tooltip when attention_requested is $attentionRequested, type is $type and, can_update_merge_request is $canUpdateMergeRequest', - ({ type, attentionRequested, tooltip, canUpdateMergeRequest }) => { - factory({ - type, - user: { - attention_requested: attentionRequested, - can_update_merge_request: canUpdateMergeRequest, - }, - }); - - expect(findToggle().attributes('aria-label')).toBe(tooltip); - }, - ); -}); diff --git a/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js b/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js index 1ea035c7184..7775ed6aa37 100644 --- a/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js +++ b/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_form_spec.js @@ -71,7 +71,12 @@ describe('Sidebar Confidentiality Form', () => { it('creates a flash if mutation contains errors', async () => { createComponent({ mutate: jest.fn().mockResolvedValue({ - data: { issuableSetConfidential: { errors: ['Houston, we have a problem!'] } }, + data: { + issuableSetConfidential: { + issuable: { confidential: false }, + errors: ['Houston, we have a problem!'], + }, + }, }), }); findConfidentialToggle().vm.$emit('click', new MouseEvent('click')); @@ -82,6 +87,24 @@ describe('Sidebar Confidentiality Form', () => { }); }); + it('emits `closeForm` event with confidentiality value when mutation is successful', async () => { + createComponent({ + mutate: jest.fn().mockResolvedValue({ + data: { + issuableSetConfidential: { + issuable: { confidential: true }, + errors: [], + }, + }, + }), + }); + + findConfidentialToggle().vm.$emit('click', new MouseEvent('click')); + await waitForPromises(); + + expect(wrapper.emitted('closeForm')).toEqual([[{ confidential: true }]]); + }); + describe('when issue is not confidential', () => { beforeEach(() => { createComponent(); diff --git a/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_widget_spec.js b/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_widget_spec.js index 1de71e52264..18ee423d12e 100644 --- a/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_widget_spec.js +++ b/spec/frontend/sidebar/components/confidential/sidebar_confidentiality_widget_spec.js @@ -132,6 +132,7 @@ describe('Sidebar Confidentiality Widget', () => { it('closes the form and dispatches an event when `closeForm` is emitted', async () => { createComponent(); const el = wrapper.vm.$el; + const closeFormPayload = { confidential: true }; jest.spyOn(el, 'dispatchEvent'); await waitForPromises(); @@ -140,12 +141,12 @@ describe('Sidebar Confidentiality Widget', () => { expect(findConfidentialityForm().isVisible()).toBe(true); - findConfidentialityForm().vm.$emit('closeForm'); + findConfidentialityForm().vm.$emit('closeForm', closeFormPayload); await nextTick(); expect(findConfidentialityForm().isVisible()).toBe(false); expect(el.dispatchEvent).toHaveBeenCalled(); - expect(wrapper.emitted('closeForm')).toHaveLength(1); + expect(wrapper.emitted('closeForm')).toEqual([[closeFormPayload]]); }); it('emits `expandSidebar` event when it is emitted from child component', async () => { diff --git a/spec/frontend/sidebar/components/incidents/escalation_status_spec.js b/spec/frontend/sidebar/components/incidents/escalation_status_spec.js index 8d8c10d10f1..83764cb6739 100644 --- a/spec/frontend/sidebar/components/incidents/escalation_status_spec.js +++ b/spec/frontend/sidebar/components/incidents/escalation_status_spec.js @@ -1,4 +1,5 @@ import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; +import { nextTick } from 'vue'; import waitForPromises from 'helpers/wait_for_promises'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import EscalationStatus from '~/sidebar/components/incidents/escalation_status.vue'; @@ -61,6 +62,8 @@ describe('EscalationStatus', () => { createComponent(); // Open dropdown await toggleDropdown(); + jest.runOnlyPendingTimers(); + await nextTick(); expect(findDropdownMenu().classes('show')).toBe(true); @@ -74,6 +77,8 @@ describe('EscalationStatus', () => { createComponent({ preventDropdownClose: true }); // Open dropdown await toggleDropdown(); + jest.runOnlyPendingTimers(); + await nextTick(); expect(findDropdownMenu().classes('show')).toBe(true); diff --git a/spec/frontend/sidebar/components/participants/sidebar_participants_widget_spec.js b/spec/frontend/sidebar/components/participants/sidebar_participants_widget_spec.js index 338ecf944f3..859e63b3df6 100644 --- a/spec/frontend/sidebar/components/participants/sidebar_participants_widget_spec.js +++ b/spec/frontend/sidebar/components/participants/sidebar_participants_widget_spec.js @@ -1,7 +1,6 @@ import { shallowMount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; -import { stripTypenames } from 'helpers/graphql_helpers'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; import Participants from '~/sidebar/components/participants/participants.vue'; @@ -67,11 +66,9 @@ describe('Sidebar Participants Widget', () => { }); it('passes participants to child component', () => { - const participantsWithoutTypename = stripTypenames( + expect(findParticipants().props('participants')).toEqual( epicParticipantsResponse().data.workspace.issuable.participants.nodes, ); - - expect(findParticipants().props('participants')).toEqual(participantsWithoutTypename); }); }); diff --git a/spec/frontend/sidebar/components/reviewers/uncollapsed_reviewer_list_spec.js b/spec/frontend/sidebar/components/reviewers/uncollapsed_reviewer_list_spec.js index 8999f120a0f..2c24df2436a 100644 --- a/spec/frontend/sidebar/components/reviewers/uncollapsed_reviewer_list_spec.js +++ b/spec/frontend/sidebar/components/reviewers/uncollapsed_reviewer_list_spec.js @@ -1,9 +1,22 @@ import { shallowMount } from '@vue/test-utils'; import { TEST_HOST } from 'helpers/test_constants'; -import AttentionRequestedToggle from '~/sidebar/components/attention_requested_toggle.vue'; import ReviewerAvatarLink from '~/sidebar/components/reviewers/reviewer_avatar_link.vue'; import UncollapsedReviewerList from '~/sidebar/components/reviewers/uncollapsed_reviewer_list.vue'; -import userDataMock from '../../user_data_mock'; + +const userDataMock = () => ({ + id: 1, + name: 'Root', + state: 'active', + username: 'root', + webUrl: `${TEST_HOST}/root`, + avatarUrl: `${TEST_HOST}/avatar/root.png`, + mergeRequestInteraction: { + canMerge: true, + canUpdate: true, + reviewed: true, + approved: false, + }, +}); describe('UncollapsedReviewerList component', () => { let wrapper; @@ -70,7 +83,10 @@ describe('UncollapsedReviewerList component', () => { id: 2, name: 'nonrooty-nonrootersen', username: 'hello-world', - approved: true, + mergeRequestInteraction: { + ...user.mergeRequestInteraction, + approved: true, + }, }; beforeEach(() => { @@ -119,18 +135,4 @@ describe('UncollapsedReviewerList component', () => { expect(wrapper.find('[data-testid="re-request-success"]').exists()).toBe(true); }); }); - - it('hides re-request review button when attentionRequired feature flag is enabled', () => { - createComponent({ users: [userDataMock()] }, { mrAttentionRequests: true }); - - expect(wrapper.findAll('[data-testid="re-request-button"]').length).toBe(0); - }); - - it('emits toggle-attention-requested', () => { - createComponent({ users: [userDataMock()] }, { mrAttentionRequests: true }); - - wrapper.find(AttentionRequestedToggle).vm.$emit('toggle-attention-requested', 'data'); - - expect(wrapper.emitted('toggle-attention-requested')[0]).toEqual(['data']); - }); }); diff --git a/spec/frontend/sidebar/mock_data.js b/spec/frontend/sidebar/mock_data.js index 229757ff40c..9c6e23e928c 100644 --- a/spec/frontend/sidebar/mock_data.js +++ b/spec/frontend/sidebar/mock_data.js @@ -343,6 +343,14 @@ export const issuableQueryResponse = { __typename: 'Issue', id: 'gid://gitlab/Issue/1', iid: '1', + author: { + id: '1', + avatarUrl: '/avatar', + name: 'root', + username: 'root', + webUrl: 'root', + status: null, + }, assignees: { nodes: [ { @@ -450,7 +458,7 @@ export const subscriptionResponse = { }, }; -const mockUser1 = { +export const mockUser1 = { __typename: 'UserCore', id: 'gid://gitlab/User/1', avatarUrl: @@ -459,6 +467,7 @@ const mockUser1 = { username: 'root', webUrl: '/root', status: null, + canMerge: false, }; export const mockUser2 = { @@ -469,6 +478,7 @@ export const mockUser2 = { username: 'rookie', webUrl: 'rookie', status: null, + canMerge: false, }; export const searchResponse = { diff --git a/spec/frontend/sidebar/reviewer_title_spec.js b/spec/frontend/sidebar/reviewer_title_spec.js index 3c250be5d5e..6b4eed5ad0f 100644 --- a/spec/frontend/sidebar/reviewer_title_spec.js +++ b/spec/frontend/sidebar/reviewer_title_spec.js @@ -47,7 +47,7 @@ describe('ReviewerTitle component', () => { editable: false, }); - expect(wrapper.find(GlLoadingIcon).exists()).toBeFalsy(); + expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); }); it('renders spinner when loading', () => { @@ -57,7 +57,7 @@ describe('ReviewerTitle component', () => { editable: false, }); - expect(wrapper.find(GlLoadingIcon).exists()).toBeTruthy(); + expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); }); it('does not render edit link when not editable', () => { diff --git a/spec/frontend/sidebar/reviewers_spec.js b/spec/frontend/sidebar/reviewers_spec.js index 351dfc9a6ed..88bacc9b7f7 100644 --- a/spec/frontend/sidebar/reviewers_spec.js +++ b/spec/frontend/sidebar/reviewers_spec.js @@ -1,9 +1,23 @@ import { GlIcon } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import { trimText } from 'helpers/text_helper'; -import UsersMockHelper from 'helpers/user_mock_data_helper'; +import { TEST_HOST } from 'helpers/test_constants'; import Reviewer from '~/sidebar/components/reviewers/reviewers.vue'; -import UsersMock from './mock_data'; + +const usersMock = (id = 1) => ({ + id, + name: 'Root', + state: 'active', + username: 'root', + webUrl: `${TEST_HOST}/root`, + avatarUrl: `${TEST_HOST}/avatar/root.png`, + mergeRequestInteraction: { + canMerge: true, + canUpdate: true, + reviewed: true, + approved: false, + }, +}); describe('Reviewer component', () => { const getDefaultProps = () => ({ @@ -42,23 +56,23 @@ describe('Reviewer component', () => { it('displays one reviewer icon when collapsed', () => { createWrapper({ ...getDefaultProps(), - users: [UsersMock.user], + users: [usersMock()], }); const collapsedChildren = findCollapsedChildren(); const reviewer = collapsedChildren.at(0); expect(collapsedChildren.length).toBe(1); - expect(reviewer.find('.avatar').attributes('src')).toBe(UsersMock.user.avatar); - expect(reviewer.find('.avatar').attributes('alt')).toBe(`${UsersMock.user.name}'s avatar`); + expect(reviewer.find('.avatar').attributes('src')).toContain('avatar/root.png'); + expect(reviewer.find('.avatar').attributes('alt')).toBe(`Root's avatar`); - expect(trimText(reviewer.find('.author').text())).toBe(UsersMock.user.name); + expect(trimText(reviewer.find('.author').text())).toBe('Root'); }); }); describe('Two or more reviewers/users', () => { it('displays two reviewer icons when collapsed', () => { - const users = UsersMockHelper.createNumberRandomUsers(2); + const users = [usersMock(), usersMock(2)]; createWrapper({ ...getDefaultProps(), users, @@ -70,21 +84,21 @@ describe('Reviewer component', () => { const first = collapsedChildren.at(0); - expect(first.find('.avatar').attributes('src')).toBe(users[0].avatar_url); + expect(first.find('.avatar').attributes('src')).toBe(users[0].avatarUrl); expect(first.find('.avatar').attributes('alt')).toBe(`${users[0].name}'s avatar`); expect(trimText(first.find('.author').text())).toBe(users[0].name); const second = collapsedChildren.at(1); - expect(second.find('.avatar').attributes('src')).toBe(users[1].avatar_url); + expect(second.find('.avatar').attributes('src')).toBe(users[1].avatarUrl); expect(second.find('.avatar').attributes('alt')).toBe(`${users[1].name}'s avatar`); expect(trimText(second.find('.author').text())).toBe(users[1].name); }); it('displays one reviewer icon and counter when collapsed', () => { - const users = UsersMockHelper.createNumberRandomUsers(3); + const users = [usersMock(), usersMock(2), usersMock(3)]; createWrapper({ ...getDefaultProps(), users, @@ -96,7 +110,7 @@ describe('Reviewer component', () => { const first = collapsedChildren.at(0); - expect(first.find('.avatar').attributes('src')).toBe(users[0].avatar_url); + expect(first.find('.avatar').attributes('src')).toBe(users[0].avatarUrl); expect(first.find('.avatar').attributes('alt')).toBe(`${users[0].name}'s avatar`); expect(trimText(first.find('.author').text())).toBe(users[0].name); @@ -107,7 +121,7 @@ describe('Reviewer component', () => { }); it('Shows two reviewers', () => { - const users = UsersMockHelper.createNumberRandomUsers(2); + const users = [usersMock(), usersMock(2)]; createWrapper({ ...getDefaultProps(), users, @@ -118,10 +132,10 @@ describe('Reviewer component', () => { }); it('shows sorted reviewer where "can merge" users are sorted first', () => { - const users = UsersMockHelper.createNumberRandomUsers(3); - users[0].can_merge = false; - users[1].can_merge = false; - users[2].can_merge = true; + const users = [usersMock(), usersMock(2), usersMock(3)]; + users[0].mergeRequestInteraction.canMerge = false; + users[1].mergeRequestInteraction.canMerge = false; + users[2].mergeRequestInteraction.canMerge = true; createWrapper({ ...getDefaultProps(), @@ -129,14 +143,14 @@ describe('Reviewer component', () => { editable: true, }); - expect(wrapper.vm.sortedReviewers[0].can_merge).toBe(true); + expect(wrapper.vm.sortedReviewers[0].mergeRequestInteraction.canMerge).toBe(true); }); it('passes the sorted reviewers to the uncollapsed-reviewer-list', () => { - const users = UsersMockHelper.createNumberRandomUsers(3); - users[0].can_merge = false; - users[1].can_merge = false; - users[2].can_merge = true; + const users = [usersMock(), usersMock(2), usersMock(3)]; + users[0].mergeRequestInteraction.canMerge = false; + users[1].mergeRequestInteraction.canMerge = false; + users[2].mergeRequestInteraction.canMerge = true; createWrapper({ ...getDefaultProps(), @@ -149,10 +163,10 @@ describe('Reviewer component', () => { }); it('passes the sorted reviewers to the collapsed-reviewer-list', () => { - const users = UsersMockHelper.createNumberRandomUsers(3); - users[0].can_merge = false; - users[1].can_merge = false; - users[2].can_merge = true; + const users = [usersMock(), usersMock(2), usersMock(3)]; + users[0].mergeRequestInteraction.canMerge = false; + users[1].mergeRequestInteraction.canMerge = false; + users[2].mergeRequestInteraction.canMerge = true; createWrapper({ ...getDefaultProps(), diff --git a/spec/frontend/sidebar/sidebar_mediator_spec.js b/spec/frontend/sidebar/sidebar_mediator_spec.js index 82fb10ab1d2..e32694abcce 100644 --- a/spec/frontend/sidebar/sidebar_mediator_spec.js +++ b/spec/frontend/sidebar/sidebar_mediator_spec.js @@ -1,12 +1,9 @@ import MockAdapter from 'axios-mock-adapter'; -import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import * as urlUtility from '~/lib/utils/url_utility'; import SidebarService, { gqClient } from '~/sidebar/services/sidebar_service'; import SidebarMediator from '~/sidebar/sidebar_mediator'; import SidebarStore from '~/sidebar/stores/sidebar_store'; -import toast from '~/vue_shared/plugins/global_toast'; -import { refreshUserMergeRequestCounts } from '~/commons/nav/user_merge_requests'; import Mock from './mock_data'; jest.mock('~/flash'); @@ -122,93 +119,4 @@ describe('Sidebar mediator', () => { urlSpy.mockRestore(); }); }); - - describe('toggleAttentionRequested', () => { - let requestAttentionMock; - let removeAttentionRequestMock; - - beforeEach(() => { - requestAttentionMock = jest.spyOn(mediator.service, 'requestAttention').mockResolvedValue(); - removeAttentionRequestMock = jest - .spyOn(mediator.service, 'removeAttentionRequest') - .mockResolvedValue(); - }); - - it.each` - attentionIsCurrentlyRequested | serviceMethod - ${true} | ${'remove'} - ${false} | ${'add'} - `( - "calls the $serviceMethod service method when the user's attention request is set to $attentionIsCurrentlyRequested", - async ({ serviceMethod }) => { - const methods = { - add: requestAttentionMock, - remove: removeAttentionRequestMock, - }; - mediator.store.reviewers = [{ id: 1, attention_requested: false, username: 'root' }]; - - await mediator.toggleAttentionRequested('reviewer', { - user: { id: 1, username: 'root' }, - callback: jest.fn(), - direction: serviceMethod, - }); - - expect(methods[serviceMethod]).toHaveBeenCalledWith(1); - expect(refreshUserMergeRequestCounts).toHaveBeenCalled(); - }, - ); - - it.each` - type | method - ${'reviewer'} | ${'findReviewer'} - `('finds $type', ({ type, method }) => { - const methodSpy = jest.spyOn(mediator.store, method); - - mediator.toggleAttentionRequested(type, { user: { id: 1 }, callback: jest.fn() }); - - expect(methodSpy).toHaveBeenCalledWith({ id: 1 }); - }); - - it.each` - attentionRequested | toastMessage - ${true} | ${'Removed attention request from @root'} - ${false} | ${'Requested attention from @root'} - `( - 'it creates toast $toastMessage when attention_requested is $attentionRequested', - async ({ attentionRequested, toastMessage }) => { - mediator.store.reviewers = [ - { id: 1, attention_requested: attentionRequested, username: 'root' }, - ]; - - await mediator.toggleAttentionRequested('reviewer', { - user: { id: 1, username: 'root' }, - callback: jest.fn(), - }); - - expect(toast).toHaveBeenCalledWith(toastMessage); - }, - ); - - describe('errors', () => { - beforeEach(() => { - jest - .spyOn(mediator.service, 'removeAttentionRequest') - .mockRejectedValueOnce(new Error('Something went wrong')); - }); - - it('shows an error message', async () => { - await mediator.toggleAttentionRequested('reviewer', { - user: { id: 1, username: 'root' }, - callback: jest.fn(), - direction: 'remove', - }); - - expect(createFlash).toHaveBeenCalledWith( - expect.objectContaining({ - message: 'Updating the attention request for root failed.', - }), - ); - }); - }); - }); }); |