diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-02 15:07:40 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-02 15:07:40 +0000 |
commit | d83c512077b9eb391ce1f59349fc7bacc3615e18 (patch) | |
tree | 1864abd445bddfe750358b054d43b52a13675e17 /spec/frontend/repository | |
parent | a72a9af092c1bfcf9f8024d59c11cf222f07e1e7 (diff) | |
download | gitlab-ce-d83c512077b9eb391ce1f59349fc7bacc3615e18.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/repository')
-rw-r--r-- | spec/frontend/repository/components/last_commit_spec.js | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/spec/frontend/repository/components/last_commit_spec.js b/spec/frontend/repository/components/last_commit_spec.js index c00cdeee05b..855837d8746 100644 --- a/spec/frontend/repository/components/last_commit_spec.js +++ b/spec/frontend/repository/components/last_commit_spec.js @@ -66,39 +66,51 @@ describe('Repository last commit component', () => { it('renders commit widget', () => { factory(); - expect(vm.element).toMatchSnapshot(); + return vm.vm.$nextTick(() => { + expect(vm.element).toMatchSnapshot(); + }); }); it('renders short commit ID', () => { factory(); - expect(vm.find('.label-monospace').text()).toEqual('12345678'); + return vm.vm.$nextTick(() => { + expect(vm.find('.label-monospace').text()).toEqual('12345678'); + }); }); it('hides pipeline components when pipeline does not exist', () => { factory(createCommitData({ pipeline: null })); - expect(vm.find('.js-commit-pipeline').exists()).toBe(false); + return vm.vm.$nextTick(() => { + expect(vm.find('.js-commit-pipeline').exists()).toBe(false); + }); }); it('renders pipeline components', () => { factory(); - expect(vm.find('.js-commit-pipeline').exists()).toBe(true); + return vm.vm.$nextTick(() => { + expect(vm.find('.js-commit-pipeline').exists()).toBe(true); + }); }); it('hides author component when author does not exist', () => { factory(createCommitData({ author: null })); - expect(vm.find('.js-user-link').exists()).toBe(false); - expect(vm.find(UserAvatarLink).exists()).toBe(false); + return vm.vm.$nextTick(() => { + expect(vm.find('.js-user-link').exists()).toBe(false); + expect(vm.find(UserAvatarLink).exists()).toBe(false); + }); }); it('does not render description expander when description is null', () => { factory(createCommitData({ description: null })); - expect(vm.find('.text-expander').exists()).toBe(false); - expect(vm.find('.commit-row-description').exists()).toBe(false); + return vm.vm.$nextTick(() => { + expect(vm.find('.text-expander').exists()).toBe(false); + expect(vm.find('.commit-row-description').exists()).toBe(false); + }); }); it('expands commit description when clicking expander', () => { @@ -113,6 +125,8 @@ describe('Repository last commit component', () => { it('renders the signature HTML as returned by the backend', () => { factory(createCommitData({ signatureHtml: '<button>Verified</button>' })); - expect(vm.element).toMatchSnapshot(); + return vm.vm.$nextTick().then(() => { + expect(vm.element).toMatchSnapshot(); + }); }); }); |