Skip to content

Commit

Permalink
added test to account for users trying to update existing cells anony…
Browse files Browse the repository at this point in the history
…mously
  • Loading branch information
eldritchreality committed May 4, 2016
1 parent 0a0a8a2 commit 59e6b9c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test-propagator-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("A propagator Cell",function(){
expect(testCell.addListener.bind(this,15)).to.throw(Error)
})

it("should update it's contents when update() is called",function(){
it("should update it's contents when update() is called",function() {
var testCell = new Cell()
var testValue = "test_value"

Expand All @@ -40,6 +40,15 @@ describe("A propagator Cell",function(){
expect(contents).to.equal(testValue);
})

it("should disallow updates to cells with existing values if the caller does not pass an identity",function() {
var testCell = new Cell()
var testValue = "test_value"
var testUpdate = "new_value"

testCell.update(testValue)
expect(testCell.update.bind(testCell,testUpdate)).to.throw(Error)
})

it("should update its listeners when its content changes",function(){
var testCell = new Cell()
var testValue = 0;
Expand Down

0 comments on commit 59e6b9c

Please sign in to comment.