|
3 | 3 | * For full copyright and license information view LICENSE file distributed with this source code.
|
4 | 4 | */
|
5 | 5 | YUI.add('ez-usermenuitemfireeventview-tests', function (Y) {
|
6 |
| - var renderTest, eventTest; |
| 6 | + var renderTest, eventTest, dataTest; |
7 | 7 |
|
8 | 8 | renderTest = new Y.Test.Case({
|
9 | 9 | name: "eZ User Menu Item Fire Event render test",
|
@@ -108,7 +108,37 @@ YUI.add('ez-usermenuitemfireeventview-tests', function (Y) {
|
108 | 108 | },
|
109 | 109 | });
|
110 | 110 |
|
| 111 | + dataTest = new Y.Test.Case({ |
| 112 | + name: "eZ User Menu Item Fire Event data test", |
| 113 | + |
| 114 | + setUp: function () { |
| 115 | + this.view = new Y.eZ.UserMenuItemFireEventView({ |
| 116 | + eventName: 'logOut' |
| 117 | + }); |
| 118 | + }, |
| 119 | + |
| 120 | + tearDown: function () { |
| 121 | + this.view.destroy(); |
| 122 | + }, |
| 123 | + |
| 124 | + "Should pass the event name to the container": function () { |
| 125 | + var container = this.view.get('container'); |
| 126 | + |
| 127 | + Y.Assert.isTrue( |
| 128 | + container.hasAttribute('data-event-name'), |
| 129 | + 'Should have a data event name attribute in the container' |
| 130 | + ); |
| 131 | + Y.Assert.areEqual( |
| 132 | + this.view.get('eventName'), container.getAttribute('data-event-name'), |
| 133 | + 'Should have the correct data event name value in the container' |
| 134 | + //'Should pass to the container the correct event name' |
| 135 | + ); |
| 136 | + }, |
| 137 | + |
| 138 | + }); |
| 139 | + |
111 | 140 | Y.Test.Runner.setName("eZ User Menu Item Fire Event View tests");
|
112 | 141 | Y.Test.Runner.add(renderTest);
|
113 | 142 | Y.Test.Runner.add(eventTest);
|
| 143 | + Y.Test.Runner.add(dataTest); |
114 | 144 | }, '', {requires: ['test', 'node-event-simulate', 'ez-usermenuitemfireeventview']});
|
0 commit comments