From f9dd5357b658ebf1339f897cc97f71a6a8f2e8c1 Mon Sep 17 00:00:00 2001 From: Pengoose Date: Wed, 19 Feb 2025 02:14:49 +0900 Subject: [PATCH] feat: add normalizeWhiteSpace flag to toHaveValue --- packages/playwright/src/matchers/matchers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright/src/matchers/matchers.ts b/packages/playwright/src/matchers/matchers.ts index d37e3285f4..ea2da6f2a1 100644 --- a/packages/playwright/src/matchers/matchers.ts +++ b/packages/playwright/src/matchers/matchers.ts @@ -355,7 +355,7 @@ export function toHaveValue( options?: { timeout?: number }, ) { return toMatchText.call(this, 'toHaveValue', locator, 'Locator', async (isNot, timeout) => { - const expectedText = serializeExpectedTextValues([expected]); + const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true }); return await locator._expect('to.have.value', { expectedText, isNot, timeout }); }, expected, options); }