Skip to content

Commit 9779fd4

Browse files
authored
test: replace Polymer based fixture elements in custom-field tests (#9113)
1 parent 34c65fa commit 9779fd4

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/custom-field/test/slot-wrapper.test.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { expect } from '@vaadin/chai-plugins';
22
import { fire, fixtureSync, nextFrame, nextRender } from '@vaadin/testing-helpers';
33
import '../src/vaadin-custom-field.js';
4-
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
54

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 = `
910
<vaadin-custom-field id="customField">
1011
<slot></slot>
1112
</vaadin-custom-field>
@@ -15,9 +16,11 @@ class XField extends PolymerElement {
1516

1617
customElements.define('x-field', XField);
1718

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 = `
2124
<vaadin-custom-field id="customField">
2225
<div id="wrapper">
2326
<slot></slot>
@@ -79,10 +82,10 @@ Object.keys(fixtures).forEach((set) => {
7982
const root = fixtureSync(fixtures[set]);
8083
if (set === 'nested' || set === 'nested2') {
8184
parent = root; // <x-field>
82-
customField = root.$.customField; // <custom-field>
85+
customField = root.shadowRoot.querySelector('vaadin-custom-field');
8386
} else if (set === 'deep' || set === 'deep2') {
8487
parent = root.firstElementChild.firstElementChild; // Inner <div>
85-
customField = root.$.customField; // <custom-field>
88+
customField = root.shadowRoot.querySelector('vaadin-custom-field');
8689
} else {
8790
parent = root; // <custom-field>
8891
customField = root; // <custom-field>

0 commit comments

Comments
 (0)