(
{ page }: TestProps,
maximized = true
)
| 514 | ).toPass(); |
| 515 | |
| 516 | export const windowIsMaximized = async ( |
| 517 | { page }: TestProps, |
| 518 | maximized = true |
| 519 | ): Promise<void> => |
| 520 | expect(async () => |
| 521 | expect( |
| 522 | await page.evaluate( |
| 523 | ([windowSelector, taskbarSelector]) => { |
| 524 | const { |
| 525 | clientWidth: windowWidth = 0, |
| 526 | clientHeight: windowHeight = 0, |
| 527 | } = document.querySelector(windowSelector) || {}; |
| 528 | const { clientHeight: taskbarHeight = 0 } = |
| 529 | document.querySelector(taskbarSelector) || {}; |
| 530 | |
| 531 | return ( |
| 532 | windowWidth === window.innerWidth && |
| 533 | windowHeight === window.innerHeight - taskbarHeight |
| 534 | ); |
| 535 | }, |
| 536 | [WINDOW_SELECTOR, TASKBAR_SELECTOR] |
| 537 | ) |
| 538 | ).toBe(maximized) |
| 539 | ).toPass(); |
| 540 | |
| 541 | // expect->locator |
| 542 | export const canvasBackgroundIsHidden = async ({ |
no test coverage detected