1
1
import { expect } from '@vaadin/chai-plugins' ;
2
2
import { fire , fixtureSync , nextFrame , nextRender } from '@vaadin/testing-helpers' ;
3
3
import '../src/vaadin-custom-field.js' ;
4
- import { html , PolymerElement } from '@polymer/polymer/polymer-element.js' ;
5
4
6
- class XField extends PolymerElement {
7
- static get template ( ) {
8
- return html `
5
+ class XField extends HTMLElement {
6
+ constructor ( ) {
7
+ super ( ) ;
8
+ this . attachShadow ( { mode : 'open' } ) ;
9
+ this . shadowRoot . innerHTML = `
9
10
<vaadin-custom-field id="customField">
10
11
<slot></slot>
11
12
</vaadin-custom-field>
@@ -15,9 +16,11 @@ class XField extends PolymerElement {
15
16
16
17
customElements . define ( 'x-field' , XField ) ;
17
18
18
- class XField2 extends PolymerElement {
19
- static get template ( ) {
20
- return html `
19
+ class XField2 extends HTMLElement {
20
+ constructor ( ) {
21
+ super ( ) ;
22
+ this . attachShadow ( { mode : 'open' } ) ;
23
+ this . shadowRoot . innerHTML = `
21
24
<vaadin-custom-field id="customField">
22
25
<div id="wrapper">
23
26
<slot></slot>
@@ -79,10 +82,10 @@ Object.keys(fixtures).forEach((set) => {
79
82
const root = fixtureSync ( fixtures [ set ] ) ;
80
83
if ( set === 'nested' || set === 'nested2' ) {
81
84
parent = root ; // <x-field>
82
- customField = root . $ . customField ; // < custom-field>
85
+ customField = root . shadowRoot . querySelector ( 'vaadin- custom-field' ) ;
83
86
} else if ( set === 'deep' || set === 'deep2' ) {
84
87
parent = root . firstElementChild . firstElementChild ; // Inner <div>
85
- customField = root . $ . customField ; // < custom-field>
88
+ customField = root . shadowRoot . querySelector ( 'vaadin- custom-field' ) ;
86
89
} else {
87
90
parent = root ; // <custom-field>
88
91
customField = root ; // <custom-field>
0 commit comments