From 942f4696e2659fe88d07fc236d953be253fc7b66 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 9 May 2015 20:40:30 +0200 Subject: [PATCH] Add tests. --- test/tests/unit/view/view.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/tests/unit/view/view.js b/test/tests/unit/view/view.js index 8113fcb5..a961bd8c 100644 --- a/test/tests/unit/view/view.js +++ b/test/tests/unit/view/view.js @@ -193,6 +193,14 @@ describe('module \'' + ID + '\'', function () { var instance = this.applyFn(); assert.isTrue(_.isFunction(instance.changeItems)); }); + + it('publishes view.changed', function () { + + var instance = this.applyFn(); + instance.setItems(); + assert.isTrue(this.xEvent.pub.calledOnce); + assert.strictEqual(this.xEvent.pub.lastCall.args[0], 'view.changed'); + }); }); describe('.setLocation()', function () { @@ -202,6 +210,14 @@ describe('module \'' + ID + '\'', function () { var instance = this.applyFn(); assert.isTrue(_.isFunction(instance.setLocation)); }); + + it('publishes view.changed', function () { + + var instance = this.applyFn(); + instance.setItems(); + assert.isTrue(this.xEvent.pub.calledOnce); + assert.strictEqual(this.xEvent.pub.lastCall.args[0], 'view.changed'); + }); }); describe('.setHint()', function () {