diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/frontend/ref | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/frontend/ref')
-rw-r--r-- | spec/frontend/ref/components/ref_selector_spec.js | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/spec/frontend/ref/components/ref_selector_spec.js b/spec/frontend/ref/components/ref_selector_spec.js index 5eee22f479e..7f0a4c7d3f4 100644 --- a/spec/frontend/ref/components/ref_selector_spec.js +++ b/spec/frontend/ref/components/ref_selector_spec.js @@ -128,14 +128,17 @@ describe('Ref selector component', () => { const selectFirstBranch = () => { findFirstBranchDropdownItem().vm.$emit('click'); + return wrapper.vm.$nextTick(); }; const selectFirstTag = () => { findFirstTagDropdownItem().vm.$emit('click'); + return wrapper.vm.$nextTick(); }; const selectFirstCommit = () => { findFirstCommitDropdownItem().vm.$emit('click'); + return wrapper.vm.$nextTick(); }; const waitForRequests = ({ andClearMocks } = { andClearMocks: false }) => @@ -522,75 +525,73 @@ describe('Ref selector component', () => { return waitForRequests(); }); - it('renders a checkmark by the selected item', () => { + it('renders a checkmark by the selected item', async () => { expect(findFirstBranchDropdownItem().find(GlIcon).element).toHaveClass( 'gl-visibility-hidden', ); - selectFirstBranch(); + await selectFirstBranch(); - return localVue.nextTick().then(() => { - expect(findFirstBranchDropdownItem().find(GlIcon).element).not.toHaveClass( - 'gl-visibility-hidden', - ); - }); + expect(findFirstBranchDropdownItem().find(GlIcon).element).not.toHaveClass( + 'gl-visibility-hidden', + ); }); describe('when a branch is seleceted', () => { - it("displays the branch name in the dropdown's button", () => { + it("displays the branch name in the dropdown's button", async () => { expect(findButtonContent().text()).toBe(DEFAULT_I18N.noRefSelected); - selectFirstBranch(); + await selectFirstBranch(); return localVue.nextTick().then(() => { expect(findButtonContent().text()).toBe(fixtures.branches[0].name); }); }); - it("updates the v-model binding with the branch's name", () => { + it("updates the v-model binding with the branch's name", async () => { expect(wrapper.vm.value).toEqual(''); - selectFirstBranch(); + await selectFirstBranch(); expect(wrapper.vm.value).toEqual(fixtures.branches[0].name); }); }); describe('when a tag is seleceted', () => { - it("displays the tag name in the dropdown's button", () => { + it("displays the tag name in the dropdown's button", async () => { expect(findButtonContent().text()).toBe(DEFAULT_I18N.noRefSelected); - selectFirstTag(); + await selectFirstTag(); return localVue.nextTick().then(() => { expect(findButtonContent().text()).toBe(fixtures.tags[0].name); }); }); - it("updates the v-model binding with the tag's name", () => { + it("updates the v-model binding with the tag's name", async () => { expect(wrapper.vm.value).toEqual(''); - selectFirstTag(); + await selectFirstTag(); expect(wrapper.vm.value).toEqual(fixtures.tags[0].name); }); }); describe('when a commit is selected', () => { - it("displays the full SHA in the dropdown's button", () => { + it("displays the full SHA in the dropdown's button", async () => { expect(findButtonContent().text()).toBe(DEFAULT_I18N.noRefSelected); - selectFirstCommit(); + await selectFirstCommit(); return localVue.nextTick().then(() => { expect(findButtonContent().text()).toBe(fixtures.commit.id); }); }); - it("updates the v-model binding with the commit's full SHA", () => { + it("updates the v-model binding with the commit's full SHA", async () => { expect(wrapper.vm.value).toEqual(''); - selectFirstCommit(); + await selectFirstCommit(); expect(wrapper.vm.value).toEqual(fixtures.commit.id); }); |