diff --git a/services/web/test/unit_frontend/coffee/ide/editor/directives/cmEditorTests.coffee b/services/web/test/unit_frontend/coffee/ide/editor/directives/cmEditorTests.coffee index ada42238af..1200d6105c 100644 --- a/services/web/test/unit_frontend/coffee/ide/editor/directives/cmEditorTests.coffee +++ b/services/web/test/unit_frontend/coffee/ide/editor/directives/cmEditorTests.coffee @@ -18,7 +18,7 @@ define ['ide/editor/directives/cmEditor'], () -> expect(@richTextInit).to.have.been.called it 'attaches to CM', () -> - inject ($compile, $rootScope) -> + inject ($compile, $rootScope, $browser) -> getSnapshot = sinon.stub() detachFromCM = sinon.stub() attachToCM = sinon.stub() @@ -30,7 +30,9 @@ define ['ide/editor/directives/cmEditor'], () -> $compile('
')($rootScope) $rootScope.$digest() - $rootScope.$digest() + # Trigger $applyAsync to evaluate the expression, normally done in the + # next tick + $browser.defer.flush() expect(detachFromCM).to.have.been.called expect(getSnapshot).to.have.been.called