Sha256: 6695f3ab664e2be35b7b4548b18f08df847e54dc7b102805bd349bcfa27d8353

Contents?: true

Size: 1.38 KB

Versions: 9

Compression:

Stored size: 1.38 KB

Contents

// ==========================================================================
// 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)
// ==========================================================================
/*global module, test, ok, equals*/
var containerView,
  pane;

module("SC.ContainerView Methods", {
  setup: function () {
    SC.run(function () {

      containerView = SC.ContainerView.create({
        nowShowing: null
      });

      pane = SC.Pane.create({
        layout: { width: 200, height: 200, left: 0, top: 0 },
        childViews: [containerView]
      }).append();
    });

    SC.run(function () {
      containerView.awake();
    });
  },

  teardown: function () {
    pane.remove();
    containerView = pane = null;
  }
});

/**
  There was a regression where destroying a ContainerView that had never had
  a nowShowing view set would throw an exception.
  */
test("Test destroy method.", function () {
  try {
    containerView.destroy();
    ok(true, "ContainerView.prototype.destroy should not fail to work if the ContainerView has no view showing.");
  } catch (ex) {
    ok(false, "ContainerView.prototype.destroy should not fail to work if the ContainerView has no view showing.  Ex: %@".fmt(ex));
  }
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js