test: add failing test for min-device-width media queries (#1298)

References #1291
This commit is contained in:
Andrey Lushnikov 2020-03-09 14:58:38 -07:00 committed by GitHub
parent c43de22193
commit a61d0660a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,11 @@ module.exports.describe = function({testRunner, expect, playwright, headless, FF
expect(await page.evaluate(() => window.innerWidth)).toBe(123);
expect(await page.evaluate(() => window.innerHeight)).toBe(456);
});
xit('should emulate *-device-width media queries', async({page, server}) => {
expect(page.viewportSize()).toEqual({width: 1280, height: 720});
await page.setViewportSize({width: 1800, height: 456});
expect(await page.evaluate(() => matchMedia('(min-device-width: 1800px)').matches)).toBe(true);
});
it('should not have touch by default', async({page, server}) => {
await page.goto(server.PREFIX + '/mobile.html');
expect(await page.evaluate(() => 'ontouchstart' in window)).toBe(false);