From 108b7f98e49cad55bcb76a9de6711a975adda746 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Thu, 19 Nov 2015 12:07:13 -0800 Subject: [PATCH] Add a couple of tests. --- test/unit/notify-path.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/unit/notify-path.html b/test/unit/notify-path.html index 11d42f22ca..7cc82c414d 100644 --- a/test/unit/notify-path.html +++ b/test/unit/notify-path.html @@ -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];