From cabd23ef8175d437e2deeeb7241c22cd6d8f3afe Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Mon, 26 Sep 2022 12:52:53 -0500 Subject: [PATCH] test(input): fix flaky masking test (#26008) --- core/src/components/input/test/masking/input.e2e.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/components/input/test/masking/input.e2e.ts b/core/src/components/input/test/masking/input.e2e.ts index 88e2d6746d..1679659530 100644 --- a/core/src/components/input/test/masking/input.e2e.ts +++ b/core/src/components/input/test/masking/input.e2e.ts @@ -9,12 +9,17 @@ test.describe('input: masking', () => { test('should filter out spaces', async ({ page, skip }) => { skip.rtl(); + const ionInput = await page.spyOnEvent('ionInput'); const input = page.locator('#inputTrimmed'); await input.click(); + // Playwright types this in one character at a time. await page.keyboard.type('S p a c e s'); + await ionInput.next(); + // ionInput is called for each character. + await expect(ionInput).toHaveReceivedEventTimes(11); await expect(input).toHaveJSProperty('value', 'Spaces'); }); });