mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Update frontend unit tests.
This commit is contained in:
@@ -4,16 +4,21 @@ define ['ide/history/HistoryV2Manager'], (HistoryV2Manager) ->
|
|||||||
@scope =
|
@scope =
|
||||||
$watch: sinon.stub()
|
$watch: sinon.stub()
|
||||||
$on: sinon.stub()
|
$on: sinon.stub()
|
||||||
|
project:
|
||||||
|
features:
|
||||||
|
versioning: true
|
||||||
@ide = {}
|
@ide = {}
|
||||||
@historyManager = new HistoryV2Manager(@ide, @scope)
|
@historyManager = new HistoryV2Manager(@ide, @scope)
|
||||||
|
|
||||||
it "should setup the history scope on intialization", ->
|
it "should setup the history scope on initialization", ->
|
||||||
expect(@scope.history).to.deep.equal({
|
expect(@scope.history).to.deep.equal({
|
||||||
isV2: true
|
isV2: true
|
||||||
updates: []
|
updates: []
|
||||||
viewMode: null
|
viewMode: null
|
||||||
nextBeforeTimestamp: null
|
nextBeforeTimestamp: null
|
||||||
atEnd: false
|
atEnd: false
|
||||||
|
userHasFullFeature: true
|
||||||
|
freeHistoryLimitHit: false
|
||||||
selection: {
|
selection: {
|
||||||
label: null
|
label: null
|
||||||
updates: []
|
updates: []
|
||||||
@@ -32,6 +37,12 @@ define ['ide/history/HistoryV2Manager'], (HistoryV2Manager) ->
|
|||||||
selectedFile: null
|
selectedFile: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
it "should setup history without full access to the feature if the project does not have versioning", ->
|
||||||
|
@scope.project.features.versioning = false
|
||||||
|
@historyManager = new HistoryV2Manager(@ide, @scope)
|
||||||
|
expect(@scope.history.userHasFullFeature).to.equal false
|
||||||
|
|
||||||
describe "_perDocSummaryOfUpdates", ->
|
describe "_perDocSummaryOfUpdates", ->
|
||||||
it "should return the range of updates for the docs", ->
|
it "should return the range of updates for the docs", ->
|
||||||
result = @historyManager._perDocSummaryOfUpdates([{
|
result = @historyManager._perDocSummaryOfUpdates([{
|
||||||
|
|||||||
Reference in New Issue
Block a user