mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-01 08:34:02 +03:00
test: locale/timeZone should affect Intl.DateTimeFormat() (#27898)
https://github.com/microsoft/playwright/issues/27802
This commit is contained in:
parent
f518684d89
commit
d983941447
@ -174,3 +174,12 @@ it('should format number in workers', async ({ browser, server }) => {
|
||||
expect(await worker.evaluate(() => (10000.20).toLocaleString())).toBe('10,000.2');
|
||||
await context.close();
|
||||
});
|
||||
|
||||
it('should affect Intl.DateTimeFormat().resolvedOptions().locale', async ({ browser, server }) => {
|
||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/27802' });
|
||||
const context = await browser.newContext({ locale: 'en-GB' });
|
||||
const page = await context.newPage();
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
expect(await page.evaluate(() => (new Intl.DateTimeFormat()).resolvedOptions().locale)).toBe('en-GB');
|
||||
await context.close();
|
||||
});
|
||||
|
@ -94,3 +94,11 @@ it('should not change default timezone in another context', async ({ browser, se
|
||||
await context.close();
|
||||
}
|
||||
});
|
||||
|
||||
it('should affect Intl.DateTimeFormat().resolvedOptions().timeZone', async ({ browser, server }) => {
|
||||
const context = await browser.newContext({ timezoneId: 'America/Jamaica' });
|
||||
const page = await context.newPage();
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
expect(await page.evaluate(() => (new Intl.DateTimeFormat()).resolvedOptions().timeZone)).toBe('America/Jamaica');
|
||||
await context.close();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user