Commit Graph
4 Commits
Author SHA1 Message Date
kawa a02df7d292 test(11-01): add Wave 0 RED scaffolds for UIE-01/02/03
- Add 8 new test functions: printers_new_returns_200, create_printer_redirects,
  printers_library_no_form, patch_printer, patch_printer_not_found,
  client_detail_returns_200, client_detail_not_found, client_links_in_printer_list
- Add FIXME comments on existing POST /printers tests noting upcoming 303 change
- All new tests FAIL against current code (proper RED TDD state)
- Existing 13 tests remain GREEN
2026-04-15 11:00:55 +02:00
kawa 6e7892e862 test(03-02): add failing tests for printer detail page
- test_printer_detail_shows_driver: asserts driver name appears on detail page
- test_printer_detail_not_found: asserts 404 for missing printer ID
- test_printer_detail_no_driver: asserts graceful display when driver is None
2026-04-10 13:04:01 +02:00
kawa 356c2ee690 feat(03-01): implement printer and client CRUD with HTMX/Alpine.js UI
- imptune/api/printers.py: POST /printers (all form fields, checkbox->bool,
  FK resolution), DELETE /printers/{id}, grouped list renderer with LEFT JOIN
- imptune/api/clients.py: POST /clients with duplicate-name handling
- imptune/api/pages.py: GET /printers and GET /clients page routes
- imptune/main.py: register printers + clients routers; close db on shutdown
- imptune/db/database.py: close existing connection before re-init (test isolation)
- templates: printers.html, clients.html, printer_form.html (Alpine.js port
  auto-derivation), printer_list.html (grouped by client), client_list.html
- tests/conftest.py: close test-thread db connection in fixture teardown
- tests/test_printer_crud.py: updated to use list(select().where()) for DB
  queries (avoids Peewee thread-local cursor caching across test boundaries)

Auto-fix [Rule 1 - Bug]: DB test isolation — Peewee thread-local connections
persisted across tests causing stale DB reads; fixed via conftest teardown and
lifespan db.close() on shutdown.
2026-04-10 12:56:09 +02:00
kawa 9bc26e377b test(03-01): add failing integration tests for printer and client CRUD
- test_create_printer_persisted: POST /printers + GET /printers
- test_create_printer_duplex/color_mode/paper_size/collate: field persistence
- test_create_client: POST /clients + GET /clients
- test_printer_grouped_by_client: client group heading in list
- test_create_printer_missing_name/invalid_ip: validation 400s
- test_delete_printer: DELETE /printers/{id} removes record
2026-04-10 12:50:00 +02:00