Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Add test for calling document.registerElement without 2nd argument
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Aug 12, 2014
1 parent c374f7e commit ee22d3b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/js/customElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ suite('customElements', function() {
assert.ok(false, 'document.registerElement failed to throw when given no arguments');
});

// http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register
test('document.registerElement second argument is optional', function() {
try {
document.registerElement('x-no-proto');
} catch(x) {
return;
}
assert.ok(true, 'document.registerElement failed to function without ElementRegistionOptions argument');
});

test('document.registerElement requires name argument to not conflict with a reserved name', function() {
try {
document.registerElement('font-face', {prototype: Object.create(HTMLElement.prototype)});
Expand Down

0 comments on commit ee22d3b

Please sign in to comment.