From 5b4b349ce0e29085aba3f5306c706554bf3e386e Mon Sep 17 00:00:00 2001 From: Damien Pobel Date: Thu, 5 Feb 2015 15:16:00 +0100 Subject: [PATCH] EZP-23098: added assertions on the navigation hub being a bubble target of items --- .../js/views/assets/ez-navigationhubview-tests.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Tests/js/views/assets/ez-navigationhubview-tests.js b/Tests/js/views/assets/ez-navigationhubview-tests.js index 7e990acd9..f62e1f650 100644 --- a/Tests/js/views/assets/ez-navigationhubview-tests.js +++ b/Tests/js/views/assets/ez-navigationhubview-tests.js @@ -484,6 +484,7 @@ YUI.add('ez-navigationhubview-tests', function (Y) { Constructor, value[0], "The " + attr + " should contain an instance of the constructor" ); + this._testEventTarget(value[0]); }, _testStructConfig: function (attr) { @@ -507,6 +508,7 @@ YUI.add('ez-navigationhubview-tests', function (Y) { config.title, value[0].get('title'), "The config should be passed to the constructor" ); + this._testEventTarget(value[0]); }, _testView: function (attr) { @@ -525,7 +527,18 @@ YUI.add('ez-navigationhubview-tests', function (Y) { instance, value[0], "The " + attr + " should contain the view instance" ); + this._testEventTarget(instance); + }, + + _testEventTarget: function (itemView) { + var evt = 'hello', + bubble = false; + this.view.on('*:' + evt, function (e) { + bubble = true; + }); + itemView.fire(evt); + Assert.isTrue(bubble, "The event should bubble from the item to the hub view"); }, "Test createNavigationItems setter (struct, no config)": function () { @@ -609,7 +622,6 @@ YUI.add('ez-navigationhubview-tests', function (Y) { createNavigationItems: [this.item1, this.item2], optimizeNavigationItems: [this.item3], }); - //this.view.render(); }, tearDown: function () {