Sha256: e768c6a61c9b521cc0a93a8bb5a82ba563df5997f24bfcef43433dec011495bd
Contents?: true
Size: 1.25 KB
Versions: 7
Compression:
Stored size: 1.25 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors. // portions copyright @2010 Apple Inc. // License: Licensed under MIT license (see license.js) // ========================================================================== /*global module test htmlbody ok equals same stop start */ var pane, menu, callCount = 0; module("SC.MenuItemView", { setup: function() { pane = SC.MainPane.create({ layout: { width: 100, height: 20, centerX: 0, centerY: 0 }, childViews: 'button'.w(), button: SC.ButtonView.design({ menuItemAction: function() { callCount += 1; } }) }).append(); pane.makeFirstResponder(pane.button); menu = SC.MenuPane.create({ items: [ { title: 'Send Action', action: 'menuItemAction' } ] }); menu.popup(pane.anchor); }, teardown: function() { pane.remove(); menu.remove(); pane = menu = null; } }); test('Sending an action with no target', function() { var itemView = menu.get('menuItemViews')[0]; itemView.sendAction(); equals(callCount, 1, 'firstResponder of main pane should be called'); });
Version data entries
7 entries across 7 versions & 1 rubygems