button-test.js revision efa2177e01a423054231b00ca0e3c518e7ec79b9
ArrayAssert = Y.ArrayAssert,
// -- Suite --------------------------------------------------------------------
// -- Node ----------------------------------------------------------------
name: 'button plugin factory',
setUp : function () {
},
tearDown: function () {
delete this.button;
},
'Disabling a button should set the `disable` attribute to `true`': function () {
},
'Enabling a button should set the `disabled` attribute to `false`': function () {
},
'Changing the label should change the `label` attribute of a button': function () {
var newText = 'foobar';
},
'Changing the label should change the `innerHTML` value of a button node': function () {
var newText = 'foobar';
},
'Changing the `disabled` attribute should fire a `disabledChange` event': function () {
var eventsTriggered = 0;
eventsTriggered+=1;
});
},
'Changing the `label` attribute should fire a `labelChange` event': function () {
var eventsTriggered = 0;
eventsTriggered+=1;
});
}
}));
// -- Widget ----------------------------------------------------------------
name: 'button widget',
setUp : function () {
Y.one("#container").setContent('<button id="testButton">Hello</button><button id="testToggleButton">Hello</button>');
srcNode: '#testButton'
}).render();
this.toggleButton = new Y.ToggleButton({
srcNode: '#testToggleButton'
}).render();
},
tearDown: function () {
delete this.button;
delete this.toggleButton;
},
'ToggleButton should have `toggle` role': function () {
var toggleButton = this.toggleButton;
},
'Selecting a toggleButton should have add class `yui3-button-selected`': function () {
var toggleButton = this.toggleButton;
// Simulate the button click
},
'Select toggling a button should fire selectedChange': function () {
var toggleButton = this.toggleButton;
var eventsTriggered = 0;
eventsTriggered+=1;
});
},
'disable() should set the disabled attribute to true': function () {
},
'enable() should set the disabled attribute to false': function () {
}
}));
}, '@VERSION@', {
});