diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-01 09:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-01 09:09:01 +0300 |
commit | b085478c4c2bed74fdc6eb2c33bfc62e791baf03 (patch) | |
tree | 71473cafdfc2f941933d326e6beb319bdbcdc79a /spec/javascripts/diffs | |
parent | 62ddd3a00522d62ab23c7804e24dbe1c941bc0a7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts/diffs')
-rw-r--r-- | spec/javascripts/diffs/components/app_spec.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/javascripts/diffs/components/app_spec.js b/spec/javascripts/diffs/components/app_spec.js index 25754eca336..266bbc1eadd 100644 --- a/spec/javascripts/diffs/components/app_spec.js +++ b/spec/javascripts/diffs/components/app_spec.js @@ -68,7 +68,7 @@ describe('diffs/components/app', () => { }); describe('fetch diff methods', () => { - beforeEach(() => { + beforeEach(done => { const fetchResolver = () => { store.state.diffs.retrievingBatches = false; return Promise.resolve(); @@ -82,6 +82,7 @@ describe('diffs/components/app', () => { spyOn(wrapper.vm, 'startRenderDiffsQueue'); spyOn(wrapper.vm, 'unwatchDiscussions'); store.state.diffs.retrievingBatches = true; + wrapper.vm.$nextTick(done); }); it('calls fetchDiffFiles if diffsBatchLoad is not enabled', done => { @@ -99,30 +100,32 @@ describe('diffs/components/app', () => { }); }); - it('calls batch methods if diffsBatchLoad is enabled, and not latest version', () => { + it('calls batch methods if diffsBatchLoad is enabled, and not latest version', done => { wrapper.vm.glFeatures.diffsBatchLoad = true; wrapper.vm.isLatestVersion = () => false; wrapper.vm.fetchData(false); expect(wrapper.vm.fetchDiffFiles).not.toHaveBeenCalled(); - wrapper.vm.$nextTick(() => { + setTimeout(() => { expect(wrapper.vm.startRenderDiffsQueue).toHaveBeenCalled(); expect(wrapper.vm.fetchDiffFilesMeta).toHaveBeenCalled(); expect(wrapper.vm.fetchDiffFilesBatch).toHaveBeenCalled(); expect(wrapper.vm.unwatchDiscussions).toHaveBeenCalled(); + done(); }); }); - it('calls batch methods if diffsBatchLoad is enabled, and latest version', () => { + it('calls batch methods if diffsBatchLoad is enabled, and latest version', done => { wrapper.vm.glFeatures.diffsBatchLoad = true; wrapper.vm.fetchData(false); expect(wrapper.vm.fetchDiffFiles).not.toHaveBeenCalled(); - wrapper.vm.$nextTick(() => { + setTimeout(() => { expect(wrapper.vm.startRenderDiffsQueue).toHaveBeenCalled(); expect(wrapper.vm.fetchDiffFilesMeta).toHaveBeenCalled(); expect(wrapper.vm.fetchDiffFilesBatch).toHaveBeenCalled(); expect(wrapper.vm.unwatchDiscussions).toHaveBeenCalled(); + done(); }); }); }); |