diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-25 15:12:32 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-25 15:12:32 +0000 |
commit | 7d8d5a3dab415672a41ab29c3bfa9581f275dc50 (patch) | |
tree | 7b9249d8ca8c12ad899b4e6d968193d58e63f458 /spec/frontend/blob/components/blob_header_spec.js | |
parent | 868c8c35fbddd439f4df76a5954e2a1caa2af3cc (diff) | |
download | gitlab-ce-7d8d5a3dab415672a41ab29c3bfa9581f275dc50.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/blob/components/blob_header_spec.js')
-rw-r--r-- | spec/frontend/blob/components/blob_header_spec.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/frontend/blob/components/blob_header_spec.js b/spec/frontend/blob/components/blob_header_spec.js index bd81b1594bf..8e1b03c6126 100644 --- a/spec/frontend/blob/components/blob_header_spec.js +++ b/spec/frontend/blob/components/blob_header_spec.js @@ -1,4 +1,5 @@ import { shallowMount, mount } from '@vue/test-utils'; +import { nextTick } from 'vue'; import BlobHeader from '~/blob/components/blob_header.vue'; import DefaultActions from '~/blob/components/blob_header_default_actions.vue'; import BlobFilepath from '~/blob/components/blob_header_filepath.vue'; @@ -139,26 +140,24 @@ describe('Blob Header Default Actions', () => { expect(wrapper.vm.viewer).toBe(null); }); - it('watches the changes in viewer data and emits event when the change is registered', () => { + it('watches the changes in viewer data and emits event when the change is registered', async () => { factory(); jest.spyOn(wrapper.vm, '$emit'); wrapper.vm.viewer = newViewer; - return wrapper.vm.$nextTick().then(() => { - expect(wrapper.vm.$emit).toHaveBeenCalledWith('viewer-changed', newViewer); - }); + await nextTick(); + expect(wrapper.vm.$emit).toHaveBeenCalledWith('viewer-changed', newViewer); }); - it('does not emit event if the switcher is not rendered', () => { + it('does not emit event if the switcher is not rendered', async () => { factory(true); expect(wrapper.vm.showViewerSwitcher).toBe(false); jest.spyOn(wrapper.vm, '$emit'); wrapper.vm.viewer = newViewer; - return wrapper.vm.$nextTick().then(() => { - expect(wrapper.vm.$emit).not.toHaveBeenCalled(); - }); + await nextTick(); + expect(wrapper.vm.$emit).not.toHaveBeenCalled(); }); }); }); |