From c1927ee6b27d11501d794f2e16711b6caa68756c Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 15 Mar 2026 04:49:41 +0000 Subject: [PATCH] test: fix all 10 failing frontend tests Updated appLauncher tests to match current session-based routing. Fixed settings test to use h2 instead of h1. Fixed RPC client test to expect 'Session expired' on 401. Co-Authored-By: Claude Opus 4.6 (1M context) --- loop/plan.md | 2 +- neode-ui/src/api/__tests__/rpc-client.test.ts | 2 +- .../src/stores/__tests__/appLauncher.test.ts | 91 +++++++++++-------- neode-ui/src/views/__tests__/settings.test.ts | 6 +- 4 files changed, 59 insertions(+), 42 deletions(-) diff --git a/loop/plan.md b/loop/plan.md index ec7af574..3a2893f5 100644 --- a/loop/plan.md +++ b/loop/plan.md @@ -86,7 +86,7 @@ - [x] **Remove dead dockerode dependency**: Run `cd /Users/dorian/Projects/archy/neode-ui && npm uninstall dockerode` and `npm uninstall @types/dockerode` if it exists. Search the codebase for any remaining imports: `grep -r "dockerode" neode-ui/src/`. Remove any dead imports found. Run `npm run type-check` to verify nothing breaks. -- [ ] **Fix the 10 failing frontend tests**: Run `cd /Users/dorian/Projects/archy/neode-ui && npm run test -- --reporter=verbose 2>&1 | head -100` to see which tests fail. Known failures: (1) `src/stores/__tests__/appLauncher.test.ts` — URL rewriting tests expecting different proxy behavior, (2) `src/views/__tests__/settings.test.ts` — heading selector `h1` not finding the heading element. For each failing test, read the test file and the component/store it tests. Update test expectations to match current implementation. Do NOT change the production code to match tests — fix the tests. Run `npm run test` until all pass. +- [x] **Fix the 10 failing frontend tests**: Run `cd /Users/dorian/Projects/archy/neode-ui && npm run test -- --reporter=verbose 2>&1 | head -100` to see which tests fail. Known failures: (1) `src/stores/__tests__/appLauncher.test.ts` — URL rewriting tests expecting different proxy behavior, (2) `src/views/__tests__/settings.test.ts` — heading selector `h1` not finding the heading element. For each failing test, read the test file and the component/store it tests. Update test expectations to match current implementation. Do NOT change the production code to match tests — fix the tests. Run `npm run test` until all pass. - [ ] **Add 404 catch-all route**: In `neode-ui/src/router/index.ts`, add a catch-all route at the end of the routes array: `{ path: '/:pathMatch(.*)*', name: 'not-found', component: () => import('@/views/NotFound.vue') }`. Create `neode-ui/src/views/NotFound.vue` — a simple view using the existing `.glass-card` class with "Page not found" message and a router-link back to `/dashboard`. Use `