Skip to content

Commit

Permalink
Add tests for #5
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero authored Jan 22, 2018
2 parents ee4a667 + f4d0ba3 commit 162f54d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 50 deletions.
50 changes: 0 additions & 50 deletions issue-5-demo.html

This file was deleted.

17 changes: 17 additions & 0 deletions test/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,23 @@

});

it("Should update options if options array is updated using dom-bind.set", function () {
domBind.set('model.Countries.0', { Name: "Russia", Selected: false });
expect(juicySelect.$select.childNodes[1].innerText).to.equal('Russia');
});

it("Should update options if options array is updated then dom-bind.notifyPath was called", function () {
model.Countries[0] = { Name: "Côte d’Ivoire", Selected: false };
domBind.notifySplices('model.Countries', [{
index: 0,
removed: [],
addedCount: 1,
object: model.Countries,
type: 'splice'
}])
expect(juicySelect.$select.childNodes[1].innerText).to.equal('Côte d’Ivoire');
});

it("Shouldn't keep a hold of to outdated value", function (done) {
domBind.set("model.TempValue", "Sweden");

Expand Down

0 comments on commit 162f54d

Please sign in to comment.