Commit ce22977f authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Use settimeoutpromise in field_spec

parent af13ffbc
import Vue from 'vue'; import Vue from 'vue';
import fieldComponent from '~/vue_shared/components/markdown/field.vue'; import fieldComponent from '~/vue_shared/components/markdown/field.vue';
import setTimeoutPromise from '../../../helpers/set_timeout_promise_helper';
describe('Markdown field component', () => { describe('Markdown field component', () => {
let vm; let vm;
...@@ -115,29 +116,19 @@ describe('Markdown field component', () => { ...@@ -115,29 +116,19 @@ describe('Markdown field component', () => {
it('clicking already active write or preview link does nothing', (done) => { it('clicking already active write or preview link does nothing', (done) => {
writeLink.click(); writeLink.click();
setTimeout(() => { setTimeoutPromise()
assertLinks(true); .then(() => assertLinks(true))
.then(() => writeLink.click())
writeLink.click(); .then(() => setTimeoutPromise())
.then(() => assertLinks(true))
setTimeout(() => { .then(() => previewLink.click())
assertLinks(true); .then(() => setTimeoutPromise())
.then(() => assertLinks(false))
previewLink.click(); .then(() => previewLink.click())
.then(() => setTimeoutPromise())
setTimeout(() => { .then(() => assertLinks(false))
assertLinks(false); .then(done)
.catch(done.fail);
previewLink.click();
setTimeout(() => {
assertLinks(false);
done();
});
});
});
});
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment