Fix incorrectly written async test

This commit is contained in:
Max Brunsfeld
2017-11-21 11:57:44 -08:00
parent 19aeabf312
commit cbd55cd921

View File

@@ -77,13 +77,11 @@ describe('TextEditorElement', () => {
})
describe('when the model is assigned', () =>
it("adds the 'mini' attribute if .isMini() returns true on the model", function (done) {
it("adds the 'mini' attribute if .isMini() returns true on the model", async () => {
const element = buildTextEditorElement()
element.getModel().update({mini: true})
atom.views.getNextUpdatePromise().then(() => {
expect(element.hasAttribute('mini')).toBe(true)
done()
})
await atom.views.getNextUpdatePromise()
expect(element.hasAttribute('mini')).toBe(true)
})
)
@@ -268,7 +266,7 @@ describe('TextEditorElement', () => {
})
)
describe('::setUpdatedSynchronously', () =>
describe('::setUpdatedSynchronously', () => {
it('controls whether the text editor is updated synchronously', () => {
spyOn(window, 'requestAnimationFrame').andCallFake(fn => fn())
@@ -288,7 +286,7 @@ describe('TextEditorElement', () => {
expect(window.requestAnimationFrame).not.toHaveBeenCalled()
expect(element.textContent).toContain('goodbye')
})
)
})
describe('::getDefaultCharacterWidth', () => {
it('returns 0 before the element is attached', () => {