Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
EZP-23098: added assertions on the navigation hub being a bubble targ…
Browse files Browse the repository at this point in the history
…et of items
  • Loading branch information
dpobel committed Feb 9, 2015
1 parent 0f3c47a commit 5b4b349
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Tests/js/views/assets/ez-navigationhubview-tests.js
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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 () {
Expand Down Expand Up @@ -609,7 +622,6 @@ YUI.add('ez-navigationhubview-tests', function (Y) {
createNavigationItems: [this.item1, this.item2],
optimizeNavigationItems: [this.item3],
});
//this.view.render();
},

tearDown: function () {
Expand Down

0 comments on commit 5b4b349

Please sign in to comment.