test(input): fix flaky masking test (#26008)

This commit is contained in:
Liam DeBeasi
2022-09-26 12:52:53 -05:00
committed by GitHub
parent fd658514b5
commit cabd23ef81

View File

@@ -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');
});
});