From 791c126df6850150c42313a880001ffe6a64ea09 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 22 Feb 2018 12:09:51 +0000 Subject: [PATCH] Fix test to match implementation --- .../coffee/ide/editor/directives/cmEditorTests.coffee | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 3f74268ad9..ada42238af 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 @@ -4,9 +4,11 @@ define ['ide/editor/directives/cmEditor'], () -> beforeEach () -> @richTextInit = sinon.stub() + @richTextOpenDoc = sinon.stub() window.Frontend = { richText: { - init: @richTextInit + init: @richTextInit, + openDoc: @richTextOpenDoc } } @@ -17,8 +19,6 @@ define ['ide/editor/directives/cmEditor'], () -> it 'attaches to CM', () -> inject ($compile, $rootScope) -> - setValue = sinon.stub() - @richTextInit.returns({ setValue: setValue }) getSnapshot = sinon.stub() detachFromCM = sinon.stub() attachToCM = sinon.stub() @@ -30,10 +30,11 @@ define ['ide/editor/directives/cmEditor'], () -> $compile('
')($rootScope) $rootScope.$digest() + $rootScope.$digest() - expect(getSnapshot).to.have.been.called - expect(setValue).to.have.been.called expect(detachFromCM).to.have.been.called + expect(getSnapshot).to.have.been.called + expect(@richTextOpenDoc).to.have.been.called expect(attachToCM).to.have.been.called it 'detaches from CM when destroyed', () ->