Skip to content

Commit d8e0b7c

Browse files
authored
test: replace Polymer based fixture element in grid-pro tests (#9134)
1 parent 08daad1 commit d8e0b7c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

packages/grid-pro/test/edit-column-renderer.test.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { enter, esc, fixtureSync, focusout, nextFrame, space } from '@vaadin/tes
44
import sinon from 'sinon';
55
import '../src/vaadin-grid-pro.js';
66
import '../src/vaadin-grid-pro-edit-column.js';
7-
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
87
import {
98
createItems,
109
dblclick,
@@ -16,20 +15,23 @@ import {
1615

1716
customElements.define(
1817
'user-editor',
19-
class extends PolymerElement {
20-
static get template() {
21-
return html`<input value="{{user.name::input}}" />`;
18+
class extends HTMLElement {
19+
#user;
20+
21+
constructor() {
22+
super();
23+
this.attachShadow({ mode: 'open' });
24+
this.shadowRoot.innerHTML = `<input>`;
25+
this.user = { name: null };
2226
}
2327

24-
static get properties() {
25-
return {
26-
user: {
27-
type: Object,
28-
value: () => {
29-
return { name: null };
30-
},
31-
},
32-
};
28+
get user() {
29+
return this.#user;
30+
}
31+
32+
set user(value) {
33+
this.#user = value;
34+
this.shadowRoot.querySelector('input').value = value.name;
3335
}
3436
},
3537
);
@@ -308,7 +310,7 @@ describe('edit column renderer', () => {
308310
it('should read the updated value based on `editorValuePath` after edit mode exit', () => {
309311
dblclick(cell._content);
310312
editor = getCellEditor(cell);
311-
editor.set('user.name', 'New');
313+
editor.user = { name: 'New' };
312314
enter(editor);
313315
expect(cell._content.textContent.trim()).to.equal('New');
314316
expect(grid.items[0].name).to.equal('New');

0 commit comments

Comments
 (0)