Skip to content

The agent that grows with you

test(desktop): trim the #109063 suite to one invariant per surface

teknium151c9e8932a1e
diff --git a/apps/desktop/src/app/chat/route-tile-reactivity.test.tsx b/apps/desktop/src/app/chat/route-tile-reactivity.test.tsx
index b01d843695c..382b31b43dd 100644
--- a/apps/desktop/src/app/chat/route-tile-reactivity.test.tsx
+++ b/apps/desktop/src/app/chat/route-tile-reactivity.test.tsx
@@ -9,7 +9,9 @@ import { RouteTilePane } from './route-tile'
// an independently-called `contributedRoutes()`, which React Compiler can keep
// memoized across the delivered subscription update. These tests run through
// the real registry, the real `useContributions` hook and the compiler-enabled
-// Vite config — mocking the route list would hide exactly this defect.
+// Vite config — mocking the route list would hide exactly this defect. The
+// `label` helper parameter is kept so a hot-replacement case can be added
+// without reshaping the fixture.
afterEach(cleanup)
@@ -39,40 +41,4 @@ describe('RouteTilePane route-contribution reactivity (#109063)', () => {
dispose()
})
})
-
- it('hot-replaces the page when the same contribution id re-registers', () => {
- let dispose = registerResetwatch('A')
- render(<RouteTilePane path="/resetwatch" />)
- expect(screen.getByText('PLUGIN-PAGE-A')).toBeTruthy()
-
- act(() => {
- dispose()
- dispose = registerResetwatch('B')
- })
- expect(screen.getByText('PLUGIN-PAGE-B')).toBeTruthy()
- expect(screen.queryByText('PLUGIN-PAGE-A')).toBeNull()
-
- act(() => {
- dispose()
- })
- })
-
- it('returns to the fallback after dispose and mounts again on re-register', () => {
- let dispose = registerResetwatch('A')
- render(<RouteTilePane path="/resetwatch" />)
-
- act(() => {
- dispose()
- })
- expect(screen.getByText(/no page at \/resetwatch/)).toBeTruthy()
-
- act(() => {
- dispose = registerResetwatch('A')
- })
- expect(screen.getByText('PLUGIN-PAGE-A')).toBeTruthy()
-
- act(() => {
- dispose()
- })
- })
})
diff --git a/apps/desktop/src/app/routes.test.ts b/apps/desktop/src/app/routes.test.ts
index b26359b523d..3c8933d9356 100644
--- a/apps/desktop/src/app/routes.test.ts
+++ b/apps/desktop/src/app/routes.test.ts
@@ -1,8 +1,6 @@
import { describe, expect, it } from 'vitest'
-import { registry } from '@/contrib/registry'
-
-import { contributedRoutes, NEW_CHAT_ROUTE, primaryRouteSelectedSessionId, ROUTES_AREA, sessionRoute, SETTINGS_ROUTE } from './routes'
+import { NEW_CHAT_ROUTE, primaryRouteSelectedSessionId, sessionRoute, SETTINGS_ROUTE } from './routes'
const SESS_A = 'sess-a'
const SESS_B = 'sess-b'
@@ -30,37 +28,3 @@ describe('primaryRouteSelectedSessionId', () => {
expect(primaryRouteSelectedSessionId(SETTINGS_ROUTE, null)).toBeNull()
})
})
-
-describe('contributedRoutes', () => {
- const page = (id: string, path: string) => ({
- id,
- area: ROUTES_AREA,
- data: { path },
- render: () => null
- })
-
- it('reads the registry when called with no arguments', () => {
- const dispose = registry.register(page('helper-contract', '/helper-contract'))
-
- try {
- expect(contributedRoutes().some(route => route.path === '/helper-contract')).toBe(true)
- } finally {
- dispose()
- }
- })
-
- it('uses an explicit snapshot instead of the registry (#109063)', () => {
- // React consumers pass their useContributions(ROUTES_AREA) snapshot so the
- // compiler-visible subscription stays a dependency of the derived routes.
- // Pin the contract: the snapshot wins even when the registry disagrees.
- const dispose = registry.register(page('helper-contract', '/helper-contract'))
-
- try {
- const routes = contributedRoutes([page('explicit', '/explicit')])
-
- expect(routes.map(route => route.path)).toEqual(['/explicit'])
- } finally {
- dispose()
- }
- })
-})