Sha256: f696e136e33c70e9207799e7b0dd1b0991aef6acd077c1fb480b22254c48a0bd

Contents?: true

Size: 1.99 KB

Versions: 11

Compression:

Stored size: 1.99 KB

Contents

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

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

var pane, view ;

module("SC.SplitView",{
  setup: function() {
    SC.RunLoop.begin();
	pane = SC.MainPane.create({
	  childViews: [ SC.SplitView.extend() ]
	});
	pane.append(); // make sure there is a layer...	    
	SC.RunLoop.end();
	
	view = pane.childViews[0];
  },
    	
  teardown: function() {
    pane.remove();
    pane = view = null ;
  }		
});

test("the views are collapsible", function() {
	equals(YES,view.canCollapseView(view.get('topLeftView')),'the top left view is collapsable');
	equals(YES,view.canCollapseView(view.get('bottomRightView')),'the bottom right view is collapsable');	
	equals(YES,view.splitViewCanCollapse(view,view.get('topLeftView')),'should return true');
	view.set('canCollapseViews','NO');
});

test("the thickness of the views",function(){
	ok(view.thicknessForView(view.get('topLeftView')),'thickness of the topLeftView');
	ok(view.thicknessForView(view.get('bottomRightView')),'thickness of the bottomRightView');
});

test("Layout direction is Horizontal",function() {
  view.set('layoutDirection', SC.LAYOUT_HORIZONTAL) ;
  equals(view.getPath('thumbViewCursor.cursorStyle'),"ew-resize",'The Cursor is');
});

test("Layout direction is Vertical",function() {
  view.set('layoutDirection', SC.LAYOUT_VERTICAL) ;
  equals(view.getPath('thumbViewCursor.cursorStyle'),"ns-resize",'The Cursor is');
});

// 
// test("performing the mouse up event", function() {
// 	var elem = thumb.get('layer');
// 	SC.Event.trigger(elem, 'mouseUp');
// });

// 	
// module("TODO: Test SC.SplitDividerView Methods");
// module("TODO: Test SC.ThumbView Methods");

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.4.4-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.4 lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.3.1 lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.3-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.3 lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.2-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.2 lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.1-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.1 lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.0-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js
sproutcore-1.4.0 lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js