Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/cortex_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,20 @@ describe("Cortex", function() {
expect(updated.c.getValue()).toEqual(this.value.c);
})
});

describe("when changing a changed value back to the original within the same tick", function() {
it("sets the last value", function() {
var updated;
var cortex = new Cortex(this.value, function(updatedCortex) {
updated = updatedCortex;
});
cortex.a.set(100);
cortex.a.set(1); // set back to original within the same tick
jasmine.clock().tick();

expect(updated.a.getValue()).toEqual(1);
});
});
});
});

Expand Down