| ... | @@ -1,26 +0,0 @@ |
| 1 | import { Children, isValidElement, type ReactElement, type ReactNode } from "react"; |
| 2 | import { RouterProvider } from "@tanstack/react-router"; |
| 3 | import { describe, expect, it } from "vite-plus/test"; |
| 4 | |
| 5 | import { ElectronBrowserHost } from "./browser/ElectronBrowserHost"; |
| 6 | import { PreviewAutomationHosts } from "./components/preview/PreviewAutomationHosts"; |
| 7 | import { QuitHoldOverlay } from "./components/QuitHoldOverlay"; |
| 8 | import { AppAtomRegistryProvider } from "./rpc/atomRegistry"; |
| 9 | import type { AppRouter } from "./router"; |
| 10 | import { AppRoot } from "./AppRoot"; |
| 11 | |
| 12 | describe("AppRoot", () => { |
| 13 | it("shares the application atom registry with routed UI and renderer-wide desktop hosts", () => { |
| 14 | const root = AppRoot({ router: {} as AppRouter }); |
| 15 | |
| 16 | expect(root.type).toBe(AppAtomRegistryProvider); |
| 17 | const children = Children.toArray( |
| 18 | (root as ReactElement<{ readonly children: ReactNode }>).props.children, |
| 19 | ); |
| 20 | expect(children).toHaveLength(4); |
| 21 | expect(isValidElement(children[0]) && children[0].type).toBe(RouterProvider); |
| 22 | expect(isValidElement(children[1]) && children[1].type).toBe(PreviewAutomationHosts); |
| 23 | expect(isValidElement(children[2]) && children[2].type).toBe(ElectronBrowserHost); |
| 24 | expect(isValidElement(children[3]) && children[3].type).toBe(QuitHoldOverlay); |
| 25 | }); |
| 26 | }); |