166
172
compare(data.action.invoked, data.invoked);
175
function test_checkable() {
176
checkableAction.checkable = true;
177
checkableAction.checked = true;
179
compare(checkableAction.checked, true, "Checkable action should be checked");
182
function test_not_checkable() {
183
checkableAction.checkable = false;
184
checkableAction.checked = true;
185
compare(checkableAction.checked, false, "Non-checkable action should never be checked");
188
function test_actionlist() {
189
verify(actionList.actions.length, 2, "Default actions not added to actionList");
192
function test_actionlist_dynamic_actions() {
193
actionList.addAction(dynamicListAction);
194
verify(actionList.actions.length, 3, "Dynamic action not added to actionList");
195
actionList.removeAction(dynamicListAction);
196
verify(actionList.actions.length, 2, "Dynamic action not remove from actionList");
199
function test_exclusive_group() {
200
compare(exclusiveGroup.actions.length, 3, "Incorrect number of actions");
203
function test_exclusive_group_activation_data() {
205
{tag: "Activate action2", active: [action2], inactive: [action1, action3], current: action2},
206
{tag: "Activate action3", active: [action3], inactive: [action1, action2], current: action3},
207
{tag: "Activate action2, action3", active: [action2, action3], inactive: [action1, action2], current: action3},
210
function test_exclusive_group_activation(data) {
211
for (var i = 0; i < data.active.length; i++) {
212
data.active[i].trigger();
213
compare(data.active[i].checked, true, "Active action checked property should be 'true'");
215
for (var i = 0; i < data.inactive.length; i++) {
216
compare(data.inactive[i].checked, false, "Inactive action checked property should be 'false'");
218
currentActionSpy.wait();
219
compare(exclusiveGroup.current, data.current, "Current action in exclusiveGroup does not match");
222
function test_always_one_action_selected() {
224
compare(action1.checked, true, "Triggering an exclusive group action should check the action");
226
compare(action1.checked, true, "Triggering an exclusive group action again will not uncheck the action.");