Class: SC.ControlTestPane


Extends SC.Pane.

Generates a pane that will display vertically stacked views for testing. You can use this class in test mode to easily create a palette with views configured in different ways.

Example

var pane = SC.ControlTestPane.design()
  .add('basic', SC.CheckboxView.design({ title: "Hello World" }))
  .add('disabled', SC.CheckboxView.design({
    title: "Hello World", isEnabled: NO
  }));

module("CheckboxView UI", pane);

test("basic", function() {
  var view = pane.view('basic');
  ok(view.get('isEnabled'), 'should be enabled');
});

Defined in: control_test_pane.js

Since:
SproutCore 1.0

Field Summary

Class Methods

Instance Methods

Field Detail

height Number

The default height of each row. This will be used for a view unless you manually specify a height in the view's layout.

Default value:
20
padding Number
The default padding added to the edges and between each row.
Default value:
4
top Number

The starting top location for the first row. This will increment as views are added to the pane.

Default value:
0

Class Method Detail

add(label, view, attrs)

Adds a test view to the control pane design. The passed label will be used as the key which you can use to find the view layer. You can either pass a view that is already designed or pass an array of attributes that will be used to create a design on the view.

Parameters:
label String
the view key name
view SC.View
a view class or view design
attrs Hash
optional attrs to use when designing the view
Returns:
SC.ControlTestPane
receiver
becomeKeyPane()
Makes the test pane the key pane, so that key handling methods can be properly tested.
show()

Registers a final test that will instantiate the control test pane and display it. This allows the developer to interact with the controls once the test has completed.

standardSetup()
Returns a standard setup/teardown object for use by the module() method.
view(keyName)

Convenience method. Returns the view with the given name on the current pane instance if there is one.

Parameters:
keyName String
the key used to register the view.
Returns:
SC.View
view instance

Instance Method Detail

view(keyName)
Retrieves the test sample view that was added with the passed key name.
Parameters:
keyName String
the key used to register the view.
Returns:
SC.View
view instance
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:20 GMT-0600 (CST)