test: make "outerWidth and outerHeight" test work on small screens (#14124)
This commit is contained in:
parent
f562058805
commit
83d82fa466
|
|
@ -30,6 +30,7 @@ it('should set the proper viewport size', async ({ page, server }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return correct outerWidth and outerHeight', async ({ page }) => {
|
it('should return correct outerWidth and outerHeight', async ({ page }) => {
|
||||||
|
await page.setViewportSize({ width: 410, height: 420 });
|
||||||
const size = await page.evaluate(() => {
|
const size = await page.evaluate(() => {
|
||||||
return {
|
return {
|
||||||
innerWidth: window.innerWidth,
|
innerWidth: window.innerWidth,
|
||||||
|
|
@ -38,8 +39,8 @@ it('should return correct outerWidth and outerHeight', async ({ page }) => {
|
||||||
outerHeight: window.outerHeight,
|
outerHeight: window.outerHeight,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
expect(size.innerWidth).toBe(1280);
|
expect(size.innerWidth).toBe(410);
|
||||||
expect(size.innerHeight).toBe(720);
|
expect(size.innerHeight).toBe(420);
|
||||||
expect(size.outerWidth >= size.innerWidth).toBeTruthy();
|
expect(size.outerWidth >= size.innerWidth).toBeTruthy();
|
||||||
expect(size.outerHeight >= size.innerHeight).toBeTruthy();
|
expect(size.outerHeight >= size.innerHeight).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue