(rect: Pick<DOMRect, 'width' | 'height'>)
| 23 | let height = window.innerHeight; |
| 24 | |
| 25 | function resize(rect: Pick<DOMRect, 'width' | 'height'>) { |
| 26 | if (rect.width > rect.height !== window.innerWidth > window.innerHeight) { |
| 27 | window.orientation = rect.width > rect.height ? 90 : 0; |
| 28 | screen.orientation.dispatchEvent(new Event('change')); |
| 29 | } |
| 30 | |
| 31 | if (rect.width !== window.innerWidth || rect.height !== window.innerHeight) { |
| 32 | window.innerWidth = rect.width; |
| 33 | window.innerHeight = rect.height; |
| 34 | window.dispatchEvent(new Event('resize')); |
| 35 | visualViewport?.dispatchEvent(new Event('resize')); |
| 36 | jest.advanceTimersByTime(200); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | beforeAll(() => { |
| 41 | document.body.appendChild(button); |
no outgoing calls
no test coverage detected