Skip to content

Commit a3a1294

Browse files
committed
Add test that attribute hydration worked
1 parent e214050 commit a3a1294

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • packages/labs/ssr/src/test/integration/tests

packages/labs/ssr/src/test/integration/tests/basic.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,23 @@ export const tests: {[name: string]: SSRTest} = {
16061606
{
16071607
args: [],
16081608
html: '<void-element-host></void-element-host>',
1609+
async check(assert: Chai.Assert, dom: HTMLElement) {
1610+
const host = dom.querySelector('void-element-host') as LitElement & {
1611+
maxLen: number;
1612+
};
1613+
assert.instanceOf(host, LitElement);
1614+
assert.equal(host.maxLen, 64);
1615+
1616+
await host.updateComplete;
1617+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
1618+
const input = host.shadowRoot?.querySelector('input')!;
1619+
assert.instanceOf(input, HTMLElement);
1620+
assert.equal(input.getAttribute('max'), '64');
1621+
1622+
host.maxLen++;
1623+
await host.updateComplete;
1624+
assert.equal(input.getAttribute('max'), '65');
1625+
},
16091626
},
16101627
],
16111628
stableSelectors: ['input'],

0 commit comments

Comments
 (0)