test(app): drop the file tree state from the browser pane fixture (#57563)

This commit is contained in:
Kit Langton
2026-10-20 20:55:16 -07:00
committed by GitHub
Unverified
parent 9b7372cf9b
commit 23f5fc935d
2 changed files with 0 additions and 10 deletions
@@ -476,23 +476,18 @@ story("selects side tabs with ⌘1–9 and ⇧⌘[ ] inside the side panel and s
story("keeps a restored browser tab selected and undrawn until the desktop's first inventory", async ({ page }) => {
const root = page.getByTestId("browser-region-fixture")
const tabs = root.getByRole("tab")
const tree = root.getByTestId("tree")
await expect(root.getByText("Registrations: 1", { exact: true })).toBeVisible()
await expect(tabs).toHaveText(["alpha.ts"])
await expect(tree).toHaveText('{"tab":"changes"}')
// Beta was left on its browser tab, which the desktop has not reported yet.
await root.getByRole("button", { name: "Beta", exact: true }).click()
await expect(root.getByText("Registrations: 2", { exact: true })).toBeVisible()
await expect(root.getByTestId("selected")).toHaveText(/^browser:tab_/)
await expect(tabs).toHaveText(["beta.ts"])
// No fallback tab was selected, so the file tab's selection never switched the tree to All files.
await expect(tree).toHaveText('{"tab":"changes"}')
await root.getByRole("button", { name: "First inventory", exact: true }).click()
await expect(tabs).toHaveText(["beta.ts", "Preview"])
await expect(root.getByRole("tab", { name: "Preview", exact: true })).toHaveAttribute("aria-selected", "true")
await expect(tree).toHaveText('{"tab":"changes"}')
})
story(
@@ -688,8 +688,6 @@ export function mountBrowserRegion(input: RegionHost) {
inspects: [],
})
// The file tree's state, Changes or All files, as the file extension stores it.
const [tree, setTree] = createSignal<object>()
const [shortcut, setShortcut] = createSignal<Accessor<string>>(() => "")
const [sideRegion, setSideRegion] = createSignal<ReturnType<RegionHost["createRegion"]>>()
const strip = (session: string) => store.strips[session] ?? { all: [] }
@@ -803,8 +801,6 @@ export function mountBrowserRegion(input: RegionHost) {
const keep = <T extends object>(key: string, initial: T) => {
const [value, set] = createStore<T>(structuredClone(initial))
if (key === "file:tree") setTree(() => value)
return {
memory: [value, (mutation: (draft: T) => void) => set(produce(mutation))] as const,
store: {
@@ -1106,7 +1102,6 @@ export function mountBrowserRegion(input: RegionHost) {
/>
<p>Registrations: {store.registrations.length}</p>
<p>Beta restores: {latest()?.restore ?? 0}</p>
<p data-testid="tree">{JSON.stringify(tree())}</p>
<p data-testid="session-state">{store.closed ? "closed" : "open"}</p>
<p data-testid="review-toggles">{store.reviews}</p>
<p data-testid="side-state">{store.opened ? "open" : "closed"}</p>