Sha256: 8e949b3f18ca1db10ee66f2493a2a4e0352ac305673ae5d2eb4478e0d63545b5
Contents?: true
Size: 1.59 KB
Versions: 2
Compression:
Stored size: 1.59 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2009 Apple Inc. and contributors. // License: Licened under MIT license (see license.js) // ========================================================================== module("SC.ButtonView#actions", { setup: function() { b = SC.ButtonView.create(); } }); test("Emulate mouse click to verify if the button activates", function() { b.triggerAction(); equals(b.get('isActive'), YES, "the should be active for 200ms"); }); test("Test different moused states", function() { b.set('isEnabled', YES); b.mouseDown(); equals(b.get('isActive'), YES, "the button should be active after a mouseDown event"); b.mouseExited(); equals(b.get('isActive'), NO, "the button should be active after a mouseDown event"); b.mouseEntered(); equals(b.get('isActive'), b._isMouseDown, "the button should be active after a mouseDown event"); // b.mouseUp(); // equals(b.get('isActive'), NO, "the button should be inactive after a mouseUP event"); b.set('buttonBehavior', SC.TOGGLE_BEHAVIOR); b._action(); equals(b.get('value'), b.get('toggleOnValue'), "the value should be the same as the toggle value"); b.set('buttonBehavior', SC.TOGGLE_ON_BEHAVIOR); b._action(); equals(b.get('value'), b.get('toggleOnValue'), "the value should be the same as the toggle value"); b.set('buttonBehavior', SC.TOGGLE_OFF_BEHAVIOR); b._action(); equals(b.get('value'), b.get('toggleOffValue'), "the value should be the same as the toggle value"); });
Version data entries
2 entries across 2 versions & 2 rubygems