diff options
author | Matija Čupić <matteeyah@gmail.com> | 2019-07-26 19:37:55 +0200 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2019-07-27 00:00:08 +0200 |
commit | 41f8cf6d8b45ff1f1e646037d6192cce20a3af8c (patch) | |
tree | ce81466591a7ac26099ba10f2b49000b4c7eed29 | |
parent | 8fb209b12d911d5a063315c169486120faf596fb (diff) | |
download | gitlab-ce-41f8cf6d8b45ff1f1e646037d6192cce20a3af8c.tar.gz |
Apply FE fix for nextTick in specs
-rw-r--r-- | spec/javascripts/jobs/components/manual_variables_form_spec.js | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/spec/javascripts/jobs/components/manual_variables_form_spec.js b/spec/javascripts/jobs/components/manual_variables_form_spec.js index b8bffbe9952..093aa905185 100644 --- a/spec/javascripts/jobs/components/manual_variables_form_spec.js +++ b/spec/javascripts/jobs/components/manual_variables_form_spec.js @@ -43,21 +43,30 @@ describe('Manual Variables Form', () => { }); describe('when adding a new variable', () => { - it('creates a new variable when user types a new key and resets the form', () => { - wrapper.find({ ref: 'inputKey' }).setValue('new key'); - - expect(wrapper.vm.variables.length).toBe(1); - expect(wrapper.vm.variables[0].key).toBe('new key'); - - expect(wrapper.find({ ref: 'inputKey' }).attributes('value')).toBe(undefined); + it('creates a new variable when user types a new key and resets the form', done => { + wrapper.vm + .$nextTick() + .then(() => wrapper.find({ ref: 'inputKey' }).setValue('new key')) + .then(() => { + expect(wrapper.vm.variables.length).toBe(1); + expect(wrapper.vm.variables[0].key).toBe('new key'); + expect(wrapper.find({ ref: 'inputKey' }).attributes('value')).toBe(undefined); + }) + .then(done) + .catch(done.fail); }); - it('creates a new variable when user types a new value and resets the form', () => { - wrapper.find({ ref: 'inputSecretValue' }).setValue('new value'); - - expect(wrapper.vm.variables.length).toBe(1); - expect(wrapper.vm.variables[0].secret_value).toBe('new value'); - expect(wrapper.find({ ref: 'inputSecretValue' }).attributes('value')).toBe(undefined); + it('creates a new variable when user types a new value and resets the form', done => { + wrapper.vm + .$nextTick() + .then(() => wrapper.find({ ref: 'inputSecretValue' }).setValue('new value')) + .then(() => { + expect(wrapper.vm.variables.length).toBe(1); + expect(wrapper.vm.variables[0].secret_value).toBe('new value'); + expect(wrapper.find({ ref: 'inputSecretValue' }).attributes('value')).toBe(undefined); + }) + .then(done) + .catch(done.fail); }); }); |