Files
polymer/test/unit/class-properties.html
2019-01-29 10:14:53 -08:00

39 lines
1.4 KiB
HTML

<!doctype html>
<!--
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<meta charset="utf-8">
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="wct-browser-config.js"></script>
<script src="../../node_modules/wct-browser-legacy/browser.js"></script>
</head>
<body>
<script type="module">
import {Polymer} from '../../polymer-legacy.js';
class Example {
ready() {}
foo() {}
}
Example.prototype.is = 'x-example';
suite('Polymer function w/Class', function() {
test('Polymer call works with a class', function() {
assert.doesNotThrow(() => Polymer(Example.prototype));
});
test('methods are copied from class input', function() {
const def = customElements.get('x-example');
assert(def.prototype.ready, 'ready should be defined');
assert(def.prototype.foo, 'foo should be defined');
});
});
</script>
</body>
</html>