From 85438edb97772d501443eaf5deaeab9f064b2045 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 15 Nov 2023 18:47:42 -0800 Subject: [PATCH] test: Intl.ListFormat is working in playwright all browsers (#28178) Fixes https://github.com/microsoft/playwright/issues/23978 --- tests/library/capabilities.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/library/capabilities.spec.ts b/tests/library/capabilities.spec.ts index fa7d6a9ede..604ad479b1 100644 --- a/tests/library/capabilities.spec.ts +++ b/tests/library/capabilities.spec.ts @@ -283,3 +283,17 @@ it('should send no Content-Length header for GET requests with a Content-Type', ]); expect(request.headers['content-length']).toBe(undefined); }); + +it('Intl.ListFormat should work', async ({ page, server }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23978' }); + await page.goto(server.EMPTY_PAGE); + const formatted = await page.evaluate(() => { + const data = ['first', 'second', 'third']; + const listFormat = new Intl.ListFormat('en', { + type: 'disjunction', + style: 'short', + }); + return listFormat.format(data); + }); + expect(formatted).toBe('first, second, or third'); +});