diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-15 15:07:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-15 15:07:58 +0300 |
commit | f26f31d2fd8e3c91677e2629293b9e0562c1437a (patch) | |
tree | 5a689004863bee4374c16920663221ea81afe664 /spec/frontend/projects | |
parent | 50e177d19bdeeb0fcc7b129b9c30841454df240b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/projects')
-rw-r--r-- | spec/frontend/projects/settings/components/new_access_dropdown_spec.js | 8 |
1 files changed, 3 insertions, 5 deletions
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 1b06f7874a3..26297d0c3ff 100644 --- a/spec/frontend/projects/settings/components/new_access_dropdown_spec.js +++ b/spec/frontend/projects/settings/components/new_access_dropdown_spec.js @@ -5,6 +5,7 @@ import { GlDropdownSectionHeader, GlSearchBoxByType, } from '@gitlab/ui'; +import { last } from 'lodash'; import { nextTick } from 'vue'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import waitForPromises from 'helpers/wait_for_promises'; @@ -254,7 +255,6 @@ describe('Access Level Dropdown', () => { createComponent({ preselectedItems }); await waitForPromises(); - const spy = jest.spyOn(wrapper.vm, '$emit'); const dropdownItems = findAllDropdownItems(); // select new item from each group findDropdownItemWithText(dropdownItems, 'role1').trigger('click'); @@ -267,7 +267,7 @@ describe('Access Level Dropdown', () => { findDropdownItemWithText(dropdownItems, 'user8').trigger('click'); findDropdownItemWithText(dropdownItems, 'key11').trigger('click'); - expect(spy).toHaveBeenLastCalledWith('select', [ + expect(last(wrapper.emitted('select'))[0]).toStrictEqual([ { access_level: 1 }, { id: 112, access_level: 2, _destroy: true }, { id: 113, access_level: 3 }, @@ -347,12 +347,10 @@ describe('Access Level Dropdown', () => { }); it('should emit `hidden` event with dropdown selection', () => { - jest.spyOn(wrapper.vm, '$emit'); - findAllDropdownItems().at(1).trigger('click'); findDropdown().vm.$emit('hidden'); - expect(wrapper.vm.$emit).toHaveBeenCalledWith('hidden', [{ access_level: 2 }]); + expect(wrapper.emitted('hidden')[0][0]).toStrictEqual([{ access_level: 2 }]); }); }); }); |