ArrayAssert = Y.ArrayAssert,
// -- Suite --------------------------------------------------------------------
// -- Lifecycle ----------------------------------------------------------------
name: 'Lifecycle',
tearDown: function () {
delete this.widget;
},
'WidgetStack should add `shim` and `zIndex` attributes': function () {
this.widget = new TestWidget({
zIndex : 10,
shim : true,
render : '#test',
visible: false
});
}
}));
// -- Attributes and Properties ------------------------------------------------
name: 'Attributes and Properties',
tearDown: function () {
delete this.widget;
},
'zIndex of "auto" parsed from a node should not override the default': function () {
// The follow nodes should all be considered to have an "auto" `zIndex`.
this.widget = new TestWidget({
render : true
});
Assert.areSame(0, parseInt(this.widget.get('boundingBox').getStyle('zIndex'), 10), 'widget bb zIndex was not 0.');
},
'srcNode in the document with position should have its zIndex parsed from the DOM': function () {
css = Y.Node.create('<div style="position: relative;" />').addClass('css-htmlparser').appendTo('#test');
this.widget = new TestWidget({
render : true
});
Assert.areSame(10, parseInt(this.widget.get('boundingBox').getStyle('zIndex'), 10), 'widget bb zIndex was not 10.');
// Clean up.
this.widget = new TestWidget({
render : true
});
Assert.areSame(2, parseInt(this.widget.get('boundingBox').getStyle('zIndex'), 10), 'widget bb zIndex was not 2.');
},
'A user specified zIndex should override the parsed zIndex value': function () {
this.widget = new TestWidget({
zIndex : 11,
render : true
});
Assert.areSame(11, parseInt(this.widget.get('boundingBox').getStyle('zIndex'), 10), 'widget bb zIndex was not 11.');
}
}));
}, '@VERSION@', {
});