Failing test

This commit is contained in:
Tony Garnock-Jones 2016-02-06 22:05:07 -05:00
parent e02755c701
commit 8c3aeec6ad
1 changed files with 20 additions and 0 deletions

View File

@ -256,4 +256,24 @@ describe('computeEvents', function () {
expect(events.metaEvents.get(0).equals(Patch.emptyPatch)).to.be(true);
});
});
describe('for a no-op but nonempty patch', function () {
var oldM = new Mux.Mux();
var pid1 = oldM.addStream(Patch.assert(["fieldContents", "initial", 7])).pid;
var pid2 = oldM.addStream(Patch.sub(["fieldContents", __, __])).pid;
var newM = oldM.shallowCopy();
var updateStreamResult =
newM.updateStream(pid1,
Patch.retract(["fieldContents", __, __])
.andThen(Patch.assert(["fieldContents", "initial", 7])));
var events = Mux.computeEvents(oldM, newM, updateStreamResult);
it('should send an empty patch to the subscriber', function () {
expect(events.eventMap.size).to.be(1);
expect(events.eventMap.has(pid2)).to.be(true);
checkPrettyPatch(events.eventMap.get(pid2).strip(),
['::: nothing'],
['::: nothing']);
});
});
});