16 Commits

Author SHA1 Message Date
djalim a6042087dc test : changed test format + added playwright support 2026-05-05 12:52:20 +00:00
djalim 2f4d8db1bf test: add full test coverage for notes, ues, ue-modules, ajustements, enseignements, users
Check Deno code / Check Deno code (pull_request) Failing after 6s
Tests / Unit tests (pull_request) Successful in 13s
Tests / Integration tests (pull_request) Failing after 1m14s
- Unit tests (mock DB + API) for all missing endpoints
- Integration tests (Drizzle direct) for all missing entities
- E2E tests (handler + real DB) for all missing endpoints
- Robustness tests: invalid inputs, SQL injection, type errors, business rule violations
- Seed helpers: seedNotes, seedUeModules, seedEnseignements, seedAjustements
- Add test:coverage and test:coverage:html tasks to deno.json

Tests expose known handler bugs (marked [BUG] in test names):
- ajustements PUT/DELETE: .where() without and() modifies all rows for student
- Missing try/catch in modules, users, enseignements handlers
- Whitespace accepted as valid string values
- No type or business rule validation (note bounds, coeff >= 0)
2026-04-26 18:25:00 +02:00
djalim e5c6c389ea test(students): add unit, integration and e2e tests for /students (#109)
Check Deno code / Check Deno code (pull_request) Failing after 5s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 58s
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE), mock DB operations
- integration: real DB CRUD via testDb (list, filter, create, get, update, delete)
- e2e: handler calls directly with mock FreshContext + real DB
  covers auth (employee vs non-employee), 400/403/404 cases
- adds test:e2e deno task and CI step
- adds tests/helpers/handler.ts with makeEmployeeContext, makeContextWithAffiliation,
  makeGetRequest, makeJsonRequest utilities

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:00:38 +02:00
djalim cdd9c0bf06 chore(test): set up integration test framework with postgres
- Generate Drizzle migrations (databases/migrations/)
- Add databases/schema.kit.ts for drizzle-kit (Node-compatible imports)
- Update drizzle.config.ts to use schema.kit.ts
- Add deno tasks: test:unit, test:integration, migrate
- Add tests/helpers/db_integration.ts: testDb, truncateAll, seed helpers
- Add .gitea/workflows/test.yml: CI with postgres service container
- Update lint.yml: run test:unit only (no DB needed)
- Update deploy.yml: add check-code job, gate deploy on it
2026-04-26 11:30:33 +00:00
djalim 612c41c099 ci: add test job to lint workflow and update deno.json
Add test script to deno.json
Add @std/assert, @std/testing, happy-dom dependencies
2026-04-21 10:14:25 +00:00
Kevin FEDYNA 4c54283bfd Finalized students app 2025-01-28 10:03:20 +01:00
Kevin FEDYNA 4ff76fdf6f Added hidden admin only page prop effect 2025-01-27 10:39:42 +01:00
Kevin FEDYNA 5464077deb Added compile task 2025-01-22 14:32:51 +01:00
Clayzxr 0672666bd3 CDN working with Docker 2025-01-21 15:17:47 +01:00
Kevin FEDYNA 9fee9ea0e8 Pending changes to add API example 2025-01-20 16:44:52 +01:00
fedyna-k 282f618386 Patched DB creation and added CLI toolchain base 2025-01-20 08:31:12 +01:00
fedyna-k 46a417f411 Added auto database creation based on sql scripts and jwt key cache 2025-01-16 23:13:58 +01:00
Kevin FEDYNA 9db588ff02 Partials OK, auto navbar and content 2025-01-15 15:43:52 +01:00
Kevin FEDYNA ed2997d51f Remaped imports to prepare for new content handling 2025-01-15 11:20:48 +01:00
fedyna-k ccad788e19 Added implementation for base page and log in log out 2025-01-14 23:34:40 +01:00
Kevin FEDYNA 9a97591bda Created fresh deno project 2024-12-02 14:36:52 +01:00