()
| 9 | // scroll behavior can be asserted. jsdom reports a 0×0 box that always counts as |
| 10 | // in-view, so without this the library never scrolls. |
| 11 | function spyOnScrollIntoView(): ReturnType<typeof vi.fn> { |
| 12 | const el = document.querySelector<HTMLElement>("#intro")!; |
| 13 | el.getBoundingClientRect = () => |
| 14 | ({ top: -500, left: 0, right: 0, bottom: -480, width: 0, height: 0, x: 0, y: 0, toJSON() {} }) as DOMRect; |
| 15 | const scrollIntoView = vi.fn(); |
| 16 | el.scrollIntoView = scrollIntoView; |
| 17 | return scrollIntoView; |
| 18 | } |
| 19 | |
| 20 | describe("allowScroll", () => { |
| 21 | it("allows body scrolling by default", () => { |
no outgoing calls
no test coverage detected
searching dependent graphs…