Sha256: 432fb4e44755f3208deed1644cb61f6ef1cc0c06a8744810b7f0b83754cbb960

Contents?: true

Size: 1.57 KB

Versions: 9

Compression:

Stored size: 1.57 KB

Contents

// ==========================================================================
// 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("SC.PanelPane UI");

var pane ;

test("verify panel content container is visible at correct location with right size", function() { 
  pane = SC.PanelPane.create({
    layout: { width: 400, height: 200, centerX: 0, centerY: 0 },
    contentView: SC.View.extend({
    })
  });
  pane.append();

  ok(pane.get('isVisibleInWindow'), 'pane.isVisibleInWindow should be YES');
  ok(pane.$().hasClass('sc-panel'), 'pane should have sc-panel class');
  ok(pane.childViews[0].get('isVisibleInWindow'), 'pane.div.isVisibleInWindow should be YES');
  ok(pane.childViews[0].$().hasClass('sc-view'), 'pane.div should have sc-view class');
  
  var pw = pane.layout.width;
  var ph = pane.layout.height;
  var ret = pane.layoutStyle();

  equals(ret.top, '50%', 'pane should center vertically');
  equals(ret.left, '50%', 'pane should center horizontally');
  equals(ret.width, '400px', 'pane should have width 400px');
  equals(ret.height, '200px', 'pane should have height 200px');
  equals(ret.marginLeft, -pw/2+'px', 'pane should shift-left %@ px'.fmt(-pw/2));
  equals(ret.marginTop, -ph/2+'px', 'pane should shift-top %@ px'.fmt(-ph/2));

  pane.remove();
}) ;

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090720093355 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.0.20090720202429 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.0.20090721125122 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.126 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.20090721145251 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.20090721145280 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.20090721145281 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.20090721145282 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js
sproutit-sproutcore-1.0.203 frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js