button-test.js revision c3e956d9b62a538911d580547f2dff07b7f0a4b0
ArrayAssert = Y.ArrayAssert,
// -- Suite --------------------------------------------------------------------
// -- Widget ----------------------------------------------------------------
name: 'button widget',
setUp : function () {
Y.one("#container").setContent('<button id="testButton">Hello</button><button id="testToggleButton">Hello</button><button id="testCheckButton">Hello</button>');
srcNode: '#testButton'
}).render();
this.toggleButton = new Y.ToggleButton({
srcNode: '#testToggleButton'
}).render();
this.checkButton = new Y.ToggleButton({
srcNode: '#testCheckButton',
type: 'checkbox'
}).render();
},
tearDown: function () {
delete this.button;
delete this.toggleButton;
delete this.checkButton;
},
'Changing the label atrribute should trigger labelChange': function () {
var eventsTriggered = 0;
eventsTriggered+=1;
});
},
'ToggleButton should have `toggle` role': function () {
var toggleButton = this.toggleButton;
},
'Selecting a toggleButton should 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 () {
},
'Setting `pressed` should toggle the `pressed` attribute': function () {
var button = this.toggleButton;
},
'Setting `checked` should toggle the `checked` attribute': function () {
var button = this.checkButton;
}
}));
}, '@VERSION@', {
});