test: add comprehensive AI feature install/uninstall test coverage

- Add 55 unit tests for feature-status.ts (installed.json CRUD, cache
  behavior, install lock, model verification, crash recovery, composite
  state) using real temp directories
- Add 36 integration tests for full install/uninstall lifecycle against
  Docker containers (face-detection bundle, SSE progress, tool gates,
  shared model protection, concurrent install prevention, auth guards,
  container restart recovery)
- Fix noise-removal CPU timeout by adding megapixel-based timeout
  calculation (120s/MP, min 5 minutes)
- Fix Playwright auth storage state race condition (mkdirSync before
  saving analytics-user.json)
- Fix 2 skipped tests in fixes-verification.spec.ts by replacing
  external ~/Downloads/sample dependency with existing test fixtures
- Enable skipped analytics-consent settings toggle test
- Restructure features.spec.ts to manage bundle state (uninstall/
  reinstall OCR) so 501 guard tests run instead of skipping
- Update noise-removal test mock to include sharp metadata() method
This commit is contained in:
SnapOtter
2026-04-28 13:27:54 +08:00
parent 60eb3abaa7
commit 4acec0846c
8 changed files with 1183 additions and 107 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ test.describe("Analytics consent page", () => {
expect(sessionData.user?.analyticsEnabled ?? true).toBe(true);
});
test.skip("settings toggle works after accepting analytics", async ({ page }) => {
test("settings toggle works after accepting analytics", async ({ page }) => {
// User already accepted in previous test — login should go straight to home
await loginAndGetToHome(page);
await expect(page).toHaveURL("/");