Remove done callbacks from spec/frontend/vue_shared/components/markdown/
The following discussion from !27779 (closed) should be addressed:
-
@winh started a discussion: (+1 comment) @epenance Sorry—only now realized we can do some more cleanup here:
For example
it('converts a line', done => { const textarea = vm.$el.querySelector('textarea'); textarea.setSelectionRange(0, 0); vm.$el.querySelectorAll('.js-md')[5].click(); Vue.nextTick(() => { expect(textarea.value).toContain('* testing'); done(); }); });
can become
it('converts a line', () => { const textarea = vm.$el.querySelector('textarea'); textarea.setSelectionRange(0, 0); vm.$el.querySelectorAll('.js-md')[5].click(); return Vue.nextTick() .then(() => { expect(textarea.value).toContain('* testing'); }); });
because Jest supports waiting for Promises.
Do you think you could go through the test files migrated here and get rid of the
done
callbacks?We can make that a separate merge request though if you prefer.