ArrayAssert = Y.ArrayAssert,
// -- Suite --------------------------------------------------------------------
// -- Lifecycle ----------------------------------------------------------------
name: 'Lifecycle',
tearDown: function () {
delete this.widget;
},
'WidgetModality should add a `modal` attribute': function () {
this.widget = new TestWidget();
},
'WidgetModality should add a mask node when `modal` is `true`': function () {
this.widget = new TestWidget({
modal : true,
render: '#test'
});
Assert.areNotSame('none', Y.one('.yui3-widget-mask').getStyle('display'), 'widget mask node was hidden.');
// Using `hide()` since WidgetModaltiy doesn't even list to its own
// `modalChange` event, which is crazy!
Assert.areSame('none', Y.one('.yui3-widget-mask').getStyle('display'), 'widget mask node was not hidden.');
},
'WidgetModality should correctly handle one mask node for multiple modal widgets': function () {
modal1 = new TestWidget({
modal : true,
render: '#test'
});
modal2 = new TestWidget({
modal: true,
render: '#test'
});
Assert.areNotSame('none', Y.one('.yui3-widget-mask').getStyle('display'), 'widget mask node was hidden.');
Assert.areNotSame('none', Y.one('.yui3-widget-mask').getStyle('display'), 'widget mask node was hidden.');
Assert.areSame('none', Y.one('.yui3-widget-mask').getStyle('display'), 'widget mask node was not hidden.');
}
}));
}, '@VERSION@', {
});