button-group-test.js revision 7a6ad76d2e039a8cbf25b4a0babafef7bbd54c01
ArrayAssert = Y.ArrayAssert,
// -- Creation ----------------------------------------------------------------
name: 'Methods',
setUp : function () {
Y.one("#container").setContent('<div id="group"><button>A</button><button>B</button><button>C</button></div>');
this.ButtonGroup = new Y.ButtonGroup({
srcNode: '#group'
}).render();
},
tearDown: function () {
},
'ButtonGroup.getButtons() should return an array of Y.Node instances': function () {
var ButtonGroup = this.ButtonGroup;
}
}));
// -- Checkbox Group ----------------------------------------------------------------
name: 'Checkbox',
setUp : function () {
Y.one("#container").setContent('<div id="group"><button>A</button><button>B</button><button>C</button></div>');
this.ButtonGroup = new Y.ButtonGroup({
srcNode: '#group',
type: 'checkbox'
}).render();
},
tearDown: function () {
},
'ButtonGroup.getSelectedButtons() should return accurate counts of selected buttons': function () {
var ButtonGroup = this.ButtonGroup;
// Ensure no buttons are selected
// Select specific buttons, and make sure the selected array jives
// Unselect
},
'ButtonGroup.getSelectedValues() should return values of selected buttons': function () {
var ButtonGroup = this.ButtonGroup;
// Ensure no buttons are selected
// Select some buttons and ensure the array of values matches
// Unselect
},
'Selecting a button should trigger selectionChange': function () {
var ButtonGroup = this.ButtonGroup;
var eventsTriggered = 0;
eventsTriggered+=1;
});
},
'Selecting a button in a group should provide an originEvent': function () {
var ButtonGroup = this.ButtonGroup;
});
}
}));
// -- Radio Group ----------------------------------------------------------------
name: 'Radio',
setUp : function () {
Y.one("#container").setContent('<div id="group"><button>A</button><button>B</button><button>C</button></div>');
this.ButtonGroup = new Y.ButtonGroup({
srcNode: '#group',
type: 'radio'
}).render();
},
tearDown: function () {
},
'ButtonGroup.getSelectedButtons() should return accurate counts of selected buttons': function () {
var ButtonGroup = this.ButtonGroup;
// Ensure no buttons are selected
// Select specific buttons, and make sure the selected array jives
}
}));
}, '@VERSION@', {
});