mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix test to match implementation
This commit is contained in:
parent
2be37795bd
commit
791c126df6
1 changed files with 6 additions and 5 deletions
|
@ -4,9 +4,11 @@ define ['ide/editor/directives/cmEditor'], () ->
|
||||||
|
|
||||||
beforeEach () ->
|
beforeEach () ->
|
||||||
@richTextInit = sinon.stub()
|
@richTextInit = sinon.stub()
|
||||||
|
@richTextOpenDoc = sinon.stub()
|
||||||
window.Frontend = {
|
window.Frontend = {
|
||||||
richText: {
|
richText: {
|
||||||
init: @richTextInit
|
init: @richTextInit,
|
||||||
|
openDoc: @richTextOpenDoc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +19,6 @@ define ['ide/editor/directives/cmEditor'], () ->
|
||||||
|
|
||||||
it 'attaches to CM', () ->
|
it 'attaches to CM', () ->
|
||||||
inject ($compile, $rootScope) ->
|
inject ($compile, $rootScope) ->
|
||||||
setValue = sinon.stub()
|
|
||||||
@richTextInit.returns({ setValue: setValue })
|
|
||||||
getSnapshot = sinon.stub()
|
getSnapshot = sinon.stub()
|
||||||
detachFromCM = sinon.stub()
|
detachFromCM = sinon.stub()
|
||||||
attachToCM = sinon.stub()
|
attachToCM = sinon.stub()
|
||||||
|
@ -30,10 +30,11 @@ define ['ide/editor/directives/cmEditor'], () ->
|
||||||
|
|
||||||
$compile('<div cm-editor sharejs-doc="sharejsDoc"></div>')($rootScope)
|
$compile('<div cm-editor sharejs-doc="sharejsDoc"></div>')($rootScope)
|
||||||
$rootScope.$digest()
|
$rootScope.$digest()
|
||||||
|
$rootScope.$digest()
|
||||||
|
|
||||||
expect(getSnapshot).to.have.been.called
|
|
||||||
expect(setValue).to.have.been.called
|
|
||||||
expect(detachFromCM).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
|
expect(attachToCM).to.have.been.called
|
||||||
|
|
||||||
it 'detaches from CM when destroyed', () ->
|
it 'detaches from CM when destroyed', () ->
|
||||||
|
|
Loading…
Reference in a new issue