mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add a test to check that users are summarised properly even when a null user occurs earlier in the update list.
This commit is contained in:
parent
eab8b4b6c8
commit
39f528bcbc
1 changed files with 27 additions and 0 deletions
|
@ -655,6 +655,33 @@ describe "UpdatesManager", ->
|
|||
end_ts: @now + 30
|
||||
}]
|
||||
|
||||
it "should include null user values, when the null is earlier in the updates list", ->
|
||||
result = @UpdatesManager._summarizeUpdates [{
|
||||
doc_id: "doc-id-1"
|
||||
meta:
|
||||
user: null
|
||||
start_ts: @now
|
||||
end_ts: @now + 10
|
||||
v: 4
|
||||
}, {
|
||||
doc_id: "doc-id-1"
|
||||
meta:
|
||||
user: @user_1
|
||||
start_ts: @now + 20
|
||||
end_ts: @now + 30
|
||||
v: 5
|
||||
}]
|
||||
expect(result).to.deep.equal [{
|
||||
docs:
|
||||
"doc-id-1":
|
||||
fromV: 4
|
||||
toV: 5
|
||||
meta:
|
||||
users: [null, @user_1]
|
||||
start_ts: @now
|
||||
end_ts: @now + 30
|
||||
}]
|
||||
|
||||
it "should roll several null user values into one", ->
|
||||
result = @UpdatesManager._summarizeUpdates [{
|
||||
doc_id: "doc-id-1"
|
||||
|
|
Loading…
Reference in a new issue