test(firefox): enable locale tests (#1562)

This commit is contained in:
Yury Semikhatsky 2020-03-26 18:14:38 -07:00 committed by GitHub
parent 4826b3aca5
commit 59fa2cba90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -9,7 +9,7 @@
"main": "index.js", "main": "index.js",
"playwright": { "playwright": {
"chromium_revision": "751710", "chromium_revision": "751710",
"firefox_revision": "1059", "firefox_revision": "1061",
"webkit_revision": "1182" "webkit_revision": "1182"
}, },
"scripts": { "scripts": {

View File

@ -322,7 +322,7 @@ module.exports.describe = function({testRunner, expect, playwright, headless, FF
expect(await page.evaluate(() => navigator.language)).toBe('fr-CH'); expect(await page.evaluate(() => navigator.language)).toBe('fr-CH');
await context.close(); await context.close();
}); });
it.fail(FFOX)('should format number', async({browser, server}) => { it('should format number', async({browser, server}) => {
{ {
const context = await browser.newContext({ locale: 'en-US' }); const context = await browser.newContext({ locale: 'en-US' });
const page = await context.newPage(); const page = await context.newPage();
@ -356,7 +356,7 @@ module.exports.describe = function({testRunner, expect, playwright, headless, FF
await context.close(); await context.close();
} }
}); });
it.fail(FFOX)('should format number in popups', async({browser, server}) => { it('should format number in popups', async({browser, server}) => {
const context = await browser.newContext({ locale: 'fr-CH' }); const context = await browser.newContext({ locale: 'fr-CH' });
const page = await context.newPage(); const page = await context.newPage();
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);

View File

@ -131,5 +131,16 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT,
expect(response.request()).toBe(request); expect(response.request()).toBe(request);
expect(response.ok()).toBe(true); expect(response.ok()).toBe(true);
}); });
it('should format number using context locale', async({browser, server}) => {
const context = await browser.newContext({ locale: 'ru-RU' });
const page = await context.newPage();
await page.goto(server.EMPTY_PAGE);
const [worker] = await Promise.all([
page.waitForEvent('worker'),
page.evaluate(() => new Worker(URL.createObjectURL(new Blob(['console.log(1)'], {type: 'application/javascript'})))),
]);
expect(await worker.evaluate(() => (10000.20).toLocaleString())).toBe('10\u00A0000,2');
await context.close();
});
}); });
}; };