<commit_before>// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
//            portions copyright @2009 Apple, Inc.
// License:   Licened under MIT license (see license.js)
// ==========================================================================

/*global module test htmlbody ok equals same stop start */

module("TODO: Test SC.MenuPane Methods");<commit_msg>Unit test to make sure SC.MenuPane sets its item targets correctly.<commit_after>// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
//            portions copyright @2009 Apple, Inc.
// License:   Licened under MIT license (see license.js)
// ==========================================================================

/*global module test htmlbody ok equals same stop start */

module("TODO: Test SC.MenuPane Methods");

var menu;
var menuItemTarget;
var menuItemTargetName = "The Target";

module('SC.MenuPane#MenuItemTargetIsSet', {
  setup: function() {
    menuItemTarget = SC.Object.create({
      myName: menuItemTargetName
    });
    
    menu = SC.MenuPane.create({
      layout: { width: 80, height: 0 },
      itemTargetKey: 'myTarget',
      itemTitleKey: 'myTitle',
      items: [
        { myTitle: "Item1", myTarget: menuItemTarget }
      ],
      contentView: SC.View.extend({})
    });
  },
  
  teardown: function() {
    menuItemTarget.destroy();
    menuItemTarget = null;
    menu.destroy();
    menu = null;
  }
});

test("Menu sets item target.", function() {
  menu.append(); // force a rendering of the menu item child views
  var target = menu.menuItemViews[0].get('target'); // see if the target propagated through
  menu.remove(); // remove the menu
  var success = (target && (target.myName === menuItemTargetName)); // check to see if it's the right target
  ok(success, "Menu item should have the target we specified.");
});
{'fraction_non_alphanumeric': 0.2475294117647059, 'fraction_numerical': 0.013647058823529411, 'mean_word_length': 3.876146788990826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5891933', 'n_tokens_mistral': 569, 'n_tokens_neox': 523, 'n_words': 176}