Sha256: 4ffd59a63d284d8424acaad5c5dad5175addc768228b7bfe6ae981ea51095b56
Contents?: true
Size: 1.24 KB
Versions: 41
Compression:
Stored size: 1.24 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // portions copyright @2011 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
41 entries across 41 versions & 1 rubygems