feat: Add comprehensive setup page tests

E2E Tests (tests/frontend/e2e/setup_page.spec.js):
- Initial page load and section display (4 tests)
- Form validation: required fields, password rules (5 tests)
- Password strength indicator with real-time updates (5 tests)
- Password visibility toggle (3 tests)
- Configuration sections: general, security, scheduler, etc (6 tests)
- Form submission: valid/invalid data, loading states (4 tests)
- Theme integration during setup (3 tests)
- Accessibility: labels, keyboard nav, ARIA (3 tests)
- Edge cases: long inputs, special chars, rapid clicks (4 tests)
Total: 37 E2E tests

API Tests (tests/api/test_setup_endpoints.py):
- Endpoint existence and valid data submission (2 tests)
- Required field validation (2 tests)
- Password strength validation (1 test)
- Already configured rejection (1 test)
- Setting validation: scheduler, logging, backup, NFO (7 tests)
- Configuration persistence to config.json (3 tests)
- Setup redirect behavior (3 tests)
- Password hashing security (1 test)
- Edge cases: Unicode, special chars, null values (4 tests)
Total: 24 API tests

Updated instructions.md marking setup tests complete
This commit is contained in:
2026-02-01 09:42:34 +01:00
parent 9ab96398b0
commit a92340aa8b
5 changed files with 960 additions and 16 deletions

View File

@@ -5,7 +5,7 @@
* Covers localStorage persistence, DOM attribute changes, and icon updates
*/
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
/**
* Mock implementation of the theme-related methods from app.js