diff --git a/packages/textfield/test/textfield.test.ts b/packages/textfield/test/textfield.test.ts index 12121c3fb7..4981cd4577 100644 --- a/packages/textfield/test/textfield.test.ts +++ b/packages/textfield/test/textfield.test.ts @@ -123,8 +123,9 @@ describe('Textfield', () => { const el = await litFixture( html` ` @@ -157,6 +158,43 @@ describe('Textfield', () => { : null; expect(input).to.not.be.null; }); + it('valid - required', async () => { + const el = await litFixture( + html` + + ` + ); + await elementUpdated(el); + + expect(el).to.not.equal(undefined); + const input = el.shadowRoot + ? el.shadowRoot.querySelector('#valid') + : null; + expect(input).to.not.be.null; + }); + it('valid - multiline - required', async () => { + const el = await litFixture( + html` + + ` + ); + await elementUpdated(el); + + expect(el).to.not.equal(undefined); + const input = el.shadowRoot + ? el.shadowRoot.querySelector('#valid') + : null; + expect(input).to.not.be.null; + }); it('valid - boundary-type assertions', async () => { const el = await litFixture( html` @@ -201,8 +239,8 @@ describe('Textfield', () => { html` ` @@ -219,9 +257,9 @@ describe('Textfield', () => { const el = await litFixture( html` @@ -241,8 +279,8 @@ describe('Textfield', () => { ` ); @@ -260,9 +298,46 @@ describe('Textfield', () => { + ` + ); + await elementUpdated(el); + + expect(el).to.not.equal(undefined); + const input = el.shadowRoot + ? el.shadowRoot.querySelector('#invalid') + : null; + expect(input).to.not.be.null; + }); + it('invalid - required', async () => { + const el = await litFixture( + html` + + ` + ); + await elementUpdated(el); + + expect(el).to.not.equal(undefined); + const input = el.shadowRoot + ? el.shadowRoot.querySelector('#invalid') + : null; + expect(input).to.not.be.null; + }); + it('invalid - multiline - required', async () => { + const el = await litFixture( + html` + ` ); @@ -280,8 +355,8 @@ describe('Textfield', () => { ` ); @@ -299,9 +374,48 @@ describe('Textfield', () => { + ` + ); + await elementUpdated(el); + + expect(el).to.not.equal(undefined); + const input = el.shadowRoot + ? el.shadowRoot.querySelector('#invalid') + : null; + expect(input).to.not.be.null; + }); + it('invalid - boundary-type assertions', async () => { + const el = await litFixture( + html` + + ` + ); + await elementUpdated(el); + + expect(el).to.not.equal(undefined); + const input = el.shadowRoot + ? el.shadowRoot.querySelector('#invalid') + : null; + expect(input).to.not.be.null; + }); + it('invalid - multiline - boundary-type assertions', async () => { + const el = await litFixture( + html` + ` );