From 59b7f4de2743b7f92683c443dde6c6dcc8eaddf2 Mon Sep 17 00:00:00 2001 From: konnorrogers Date: Wed, 18 Sep 2024 16:51:57 -0400 Subject: [PATCH] fix crashing in form.test.ts --- src/internal/form.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/internal/form.test.ts b/src/internal/form.test.ts index 42cdaf9b4..ba1d1269d 100644 --- a/src/internal/form.test.ts +++ b/src/internal/form.test.ts @@ -2,13 +2,13 @@ import { aTimeout, expect, waitUntil } from '@open-wc/testing'; import { fixtures } from './test/fixture.js'; import { html } from 'lit'; import sinon from 'sinon'; +import { clickOnElement } from './test.js'; describe('Form tests', () => { for (const fixture of fixtures) { describe(`with "${fixture.type}" rendering`, () => { // Reproduction of this issue: https://github.com/shoelace-style/shoelace/issues/1703 it('Should still run form validations if an element is removed', async () => { - await aTimeout(500); const form = await fixture(html`
@@ -28,6 +28,10 @@ describe('Form tests', () => { expect(form.checkValidity()).to.equal(false); expect(form.reportValidity()).to.equal(false); + + // This is silly,but it fixes an issue with `reportValidity()` causing WebKit to crash. + await clickOnElement(document.body); + await aTimeout(100); }); it('should submit the correct form values', async () => {