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:
Shane Kilkelly 2015-09-11 14:12:01 +01:00
parent eab8b4b6c8
commit 39f528bcbc

View file

@ -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"