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