|
12 | 12 | <head>
|
13 | 13 | <title>test-fixture</title>
|
14 | 14 |
|
| 15 | + <script> |
| 16 | + // Save original HTMLElement constructor since customElements v1 polyfill |
| 17 | + // overrides it https://github.com/webcomponents/webcomponentsjs/issues/623 |
| 18 | + var _HTMLElement = window.HTMLElement; |
| 19 | + </script> |
| 20 | + |
15 | 21 | <script src="../../webcomponentsjs-v1/webcomponents-lite.js"></script>
|
16 | 22 | <script src="../../web-component-tester/browser.js"></script>
|
17 | 23 |
|
|
21 | 27 | <body>
|
22 | 28 | <script>
|
23 | 29 | (function() {
|
24 |
| - // Flag to enable takeRecords/flush for CustomElements v1 polyfill. |
25 |
| - // https://github.com/webcomponents/custom-elements#differences-from-spec |
26 |
| - customElements.enableFlush = true; |
27 |
| - |
28 | 30 | function XCustom() {
|
29 | 31 | if (window.Reflect) {
|
30 | 32 | return Reflect.construct(HTMLElement, [], XCustom)
|
|
177 | 179 |
|
178 | 180 | describe('for a dom with a single root element', function () {
|
179 | 181 | it('returns a reference to the root element', function () {
|
180 |
| - expect(el).to.be.instanceOf(HTMLElement); |
| 182 | + expect(el).to.be.instanceOf(_HTMLElement); |
181 | 183 | });
|
182 | 184 | });
|
183 | 185 |
|
|
196 | 198 |
|
197 | 199 | it('returns an array of root elements', function () {
|
198 | 200 | expect(els).to.be.instanceOf(Array);
|
199 |
| - expect(els[0]).to.be.instanceOf(HTMLElement); |
200 |
| - expect(els[1]).to.be.instanceOf(HTMLElement); |
| 201 | + expect(els[0]).to.be.instanceOf(_HTMLElement); |
| 202 | + expect(els[1]).to.be.instanceOf(_HTMLElement); |
201 | 203 | });
|
202 | 204 | });
|
203 | 205 |
|
|
215 | 217 |
|
216 | 218 | it('returns an array with elements grouped by template', function () {
|
217 | 219 | expect(groups).to.be.instanceOf(Array);
|
218 |
| - expect(groups[0]).to.be.instanceOf(HTMLElement); |
| 220 | + expect(groups[0]).to.be.instanceOf(_HTMLElement); |
219 | 221 | expect(groups[1]).to.be.instanceOf(Array);
|
220 |
| - expect(groups[1][0]).to.be.instanceOf(HTMLElement); |
221 |
| - expect(groups[1][1]).to.be.instanceOf(HTMLElement); |
| 222 | + expect(groups[1][0]).to.be.instanceOf(_HTMLElement); |
| 223 | + expect(groups[1][1]).to.be.instanceOf(_HTMLElement); |
222 | 224 | });
|
223 | 225 | });
|
224 | 226 |
|
|
232 | 234 | });
|
233 | 235 |
|
234 | 236 | it('returns a single element if the template has a single child', function() {
|
235 |
| - expect(el).to.be.instanceOf(HTMLElement); |
| 237 | + expect(el).to.be.instanceOf(_HTMLElement); |
236 | 238 | });
|
237 | 239 |
|
238 | 240 | it('returns multiple elements if the template has multiple children', function() {
|
|
0 commit comments