(opts: { keepDefaultStyle: boolean })
| 19 | }); |
| 20 | |
| 21 | function addCustomFooterButton(opts: { keepDefaultStyle: boolean }): { |
| 22 | button: HTMLButtonElement; |
| 23 | onClick: ReturnType<typeof vi.fn>; |
| 24 | } { |
| 25 | const onClick = vi.fn(); |
| 26 | const button = document.createElement("button"); |
| 27 | button.id = "custom-footer-btn"; |
| 28 | button.innerText = "Custom"; |
| 29 | if (opts.keepDefaultStyle) { |
| 30 | button.classList.add("driver-popover-footer-btn"); |
| 31 | } |
| 32 | button.addEventListener("click", onClick); |
| 33 | |
| 34 | const d = createDriver({ |
| 35 | animate: false, |
| 36 | steps: SAMPLE_STEPS, |
| 37 | onPopoverRender: popover => { |
| 38 | popover.footerButtons.appendChild(button); |
| 39 | }, |
| 40 | }); |
| 41 | d.drive(); |
| 42 | |
| 43 | return { button, onClick }; |
| 44 | } |
| 45 | |
| 46 | describe("footer button styling", () => { |
| 47 | it("styles the built-in navigation buttons through the footer button class", () => { |
no test coverage detected
searching dependent graphs…