Skip to content

Commit

Permalink
add test for legacy Polymer({}) elements
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Dec 7, 2017
1 parent 02c06aa commit 8a1c76c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unit/html-tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@
}

customElements.define(HtmlFnSub.is, HtmlFnSub);

Polymer({
is: 'html-legacy',
_template: Polymer.html`
<div id="child">[[databoundProperty]]</div>
`,
properties: {
databoundProperty: {
type: String,
value: 'legacy'
}
}
});
});

test('Polymer elements can use html fn', function () {
Expand All @@ -108,6 +121,13 @@
assert(el.$.child);
assert.equal(el.$.child.textContent.trim(), 'second');
});

test('legacy element works with html fn', function() {
let el = document.createElement('html-legacy');
document.body.appendChild(el);
assert(el.shadowRoot);
assert.equal(el.$.child.textContent.trim(), 'legacy');
});
});
</script>
</body>
Expand Down

0 comments on commit 8a1c76c

Please sign in to comment.