| <html> |
| <import src="../resources/mocha.sky" /> |
| <import src="../resources/chai.sky" /> |
| <script> |
| describe("Custom element constructor", function() { |
| it("should inherit from the passed constructor", function() { |
| class TestElementClass extends HTMLElement { |
| static test() { return 10; } |
| } |
| var TestElement = document.registerElement("test-element-1", { |
| prototype: TestElementClass.prototype, |
| }); |
| assert.isFunction(TestElement.test); |
| assert.equal(TestElement.test(), 10); |
| assert.equal(Object.getPrototypeOf(TestElement), TestElementClass); |
| }); |
| }); |
| </script> |
| </html> |