Sha256: c6f4a08aaa508db06b7f675346900f93991ef769836f4b822df359cf1ae743f5

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 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();
    });
  },

  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

2 entries across 2 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js