// ========================================================================== // 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) // ========================================================================== var view ; var content = "1 2 3 4 5 6 7 8 9 10".w().map(function(x) { return SC.Object.create({ title: x }); }); module("SC.CollectionView.selection", { setup: function() { view = SC.CollectionView.create({ isVisibleInWindow: YES, // force render content: content }); } }); /* Helper method to validate that the item views in the view have the proper selection state. Pass in the collection view and the selection. @param {SC.CollectionView} view the view to test @param {SC.IndexSet} sel the index set @param {String} testName the name of the test @returns {void} */ function verifySelection(view, sel, testName) { var childViews = view.get('childViews'), len = childViews.get('length'), idx, itemView, expected, actual ; if (!testName) testName = ''; equals(len, view.get('nowShowing').get('length'), '%@ precond - must have childViews for each nowShowing'.fmt(testName)); for(idx=0;idx