Skip to content

Commit

Permalink
add tests for new Polymer() argument support (and make Base tests awa…
Browse files Browse the repository at this point in the history
…re of new abstract method `_desugarBehaviors`)
  • Loading branch information
Scott J Miles committed Aug 25, 2015
1 parent 6224dc3 commit 9734a3a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/unit/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
Child._registerFeatures = function() {};
Child._initFeatures = function() {};
Child._setAttributeToProperty = function() {};
Child._desugarBehaviors = function() {};
Child._doBehavior = function(name, args) {
if (this[name]) {
this[name].apply(this, args || []);
Expand Down
11 changes: 11 additions & 0 deletions test/unit/micro-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,14 @@
});

</script>


<dom-module id="falsey-polymer-arg">

<script>

Polymer();

</script>

</dom-module>
14 changes: 14 additions & 0 deletions test/unit/micro.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,20 @@
assert.equal(b.getAttribute('is'), 'x-mixed-case-button');
});

test('input to Polymer is a `class`', function() {
var _class = function() {};
_class.prototype = {
is: 'x-class-as-argument-test'
};
Polymer(_class);
var a = document.createElement('x-class-as-argument-test');
assert.equal(a.is, 'x-class-as-argument-test');
});

test('input to Polymer is falsey', function() {
var a = document.createElement('falsey-polymer-arg');
assert.equal(a.is, 'falsey-polymer-arg');
});
});

</script>
Expand Down

0 comments on commit 9734a3a

Please sign in to comment.