Skip to content

Commit

Permalink
Add a couple of tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Nov 19, 2015
1 parent 5076ee0 commit 108b7f9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/notify-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,18 @@
assert.equal(el.get('nested.again.again.wayOverThere'), 99);
});

test('notifyPath calls observer', function() {
el.a = {b: {c: true}};
sinon.spy(el, 'aChanged');
el.notifyPath('a.b.c', el.a.b.c);
assert.isTrue(el.aChanged.calledOnce);
assert.equal(el.get('a.b.c'), true);
});

test('notifyPath a non-extistant does nothing', function() {
el.notifyPath('does.not.exist', true);
});

test('get array', function() {
el.arrayChanged = function() {};
el.array = [1, 2, 3];
Expand Down

0 comments on commit 108b7f9

Please sign in to comment.