Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More tests

  • Loading branch information...
commit 1c301952b8133f8a04b1e736d1e3a59c842661c4 1 parent 8f41991
Kris Zyp kriszyp authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 tests/compose.js
23 tests/compose.js
View
@@ -91,6 +91,19 @@ exports.testAround = function() {
widget.render();
assert.equal(node.innerHTML, "<hi>Title</h1><div>Hello, World</div>");
};
+exports.testDontEnum = function() {
+ var DontEnumWidget = Compose(MessageWidget, {
+ message: "Hello, World",
+ dontEnum: Compose.dontEnum(3)
+ });
+ var widget = new DontEnumWidget({});
+ assert.equal(widget.dontEnum, 3);
+ if(Object.defineProperty){
+ for(var i in widget){
+ assert.notEqual(i, "dontEnum");
+ }
+ }
+};
exports.testRequired = function() {
var logged;
var Logger = Compose({
@@ -139,6 +152,16 @@ exports.testInheritanceCreate= function() {
assert.equal(widget.node.innerHTML, "<div>Hello, World</div>");
assert.equal(widget.foo, "bar");
};
+exports.testNestedCompose = function() {
+ var ComposingWidget = Compose(Compose, {
+ foo: "bar"
+ });
+ widget = ComposingWidget({
+ bar: "foo"
+ });
+ assert.equal(widget.bar, "foo");
+ assert.equal(widget.foo, "bar");
+};
if (require.main === module)
require("patr/runner").run(exports);
Please sign in to comment.
Something went wrong with that request. Please try again.