11 Commits
Author SHA1 Message Date
maziggy b51598ea69 fix(printers): refuse to add a printer when the MQTT probe fails (#empty-card-reports)
Several support reports traced back to one root cause: a mistyped access
  code in Add Printer left an empty card on the dashboard. POST /printers/
  was persisting the row first, then firing connect_printer() fire-and-forget.

  Now we test_connection() BEFORE the insert; failure returns HTTP 400 and
  the row is never written.

  Structured error response -- detail={"code", "message"} -- so the toast
  shows the localized message instead of the English fallback. New
  ApiError.code field on the frontend; printers.toast.connectionFailedNotAdded
2026-05-17 15:42:19 +02:00
maziggy 9a69e2ea97 Housekeeping 2026-05-05 10:54:14 +02:00
Martha Augsburger 7baf1caf75 UI/multi color handling (#1205) 2026-05-05 09:34:16 +02:00
maziggy b453385d22 Add location filter tests and changelog entry for printer search (#920)
PR #920 was merged without a CHANGELOG entry and without test coverage
  for the location filter dropdown (every other new control — name
  search, model search, serial search, whitespace trim, clear button,
  status filter, empty states, combined filters — already had tests).

  Adds:
  - `filters by location via dropdown` — overrides the printers mock so
    printer 1 has location 'Workshop' and printer 2 has location
    'Office', then verifies that selecting each location shows only the
    matching printer and that switching between the two works.
  - `hides location filter when no printers have a location` — both
    printers get a null location, and the test asserts the status filter
    dropdown is still rendered but the location filter dropdown is not.
  - CHANGELOG entry under [0.2.3b3] > New Features crediting the
    contributor and documenting the search/filter feature, including the
    WebSocket-reactive status filter behavior.
2026-04-10 12:32:23 +02:00
lietschaend 8305ba9fb7 Feature/printer search filter (#920)
* feat(printers): add live search/filter bar to printers page

Adds a search bar below the page title that filters the printer list
in real time by name, model, location, and serial number. Includes an
X button to clear the search and an empty-state message when no
printers match. Filtering is purely client-side — no backend changes
needed.

Closes #852
2026-04-10 12:25:04 +02:00
maziggy 6e2788517c Updated test_backend.sh 2026-02-27 09:48:31 +01:00
maziggy cffe7e62bc Fix maintenance tasks showing wrong rod type for printer models (#351)
H2/A1 series have linear rails, not carbon rods. X1/P1/P2S have carbon
rods, not linear rails. Split rod-specific maintenance into model-aware
pairs: "Lubricate/Clean Carbon Rods" for X1/P1/P2S and "Lubricate/Clean
Linear Rails" for A1/H2. Added rod type classification to printer_models
and startup cleanup for stale/duplicate system maintenance types.
2026-02-13 12:23:34 +01:00
maziggy d02a9d8e36 Updated test_backend.sh
- Skip FTP tests by default
- Added option --full to include FTP tests
2026-02-08 09:36:17 +01:00
maziggy 39f90616f3 Post work #2 PR #262 2026-02-04 16:12:57 +01:00
maziggy 2d445badac Fix printer deletion freeze and allow multiple smart plugs per printer (Issue #214)
Bug 1: Delete printer was not actually deleting archives when
delete_archives=True (default). The if-condition was inverted, causing
archives to remain and potentially causing FK constraint issues.

Bug 2: SmartPlug.printer_id had unique=True constraint, preventing
multiple HA scripts from being linked to the same printer. Removed the
constraint to allow multiple plugs/scripts per printer (matching
feature/176 behavior).

Closes #214
2026-02-01 14:39:04 +01:00
maziggy ff53e62ef8 Add comprehensive automated testing infrastructure
Backend:
  - pytest configuration with async support and coverage
  - Unit tests for notification service (23 tests)
  - Unit tests for smart plug manager (12 tests)
  - Unit tests for archive service (16 tests)
  - Integration tests for API endpoints
  - Fix: notifications now send immediately (digest is summary only)

  Frontend:
  - Vitest configuration with jsdom and coverage
  - MSW for API mocking
  - Component tests for Toggle, Button, Card, ConfirmModal (77 tests)
  - Test utilities with custom render wrapper

  CI/CD:
  - GitHub Actions workflow for automated testing
  - Backend lint, unit tests, integration tests
  - Frontend lint, type-check, unit tests, build
2025-12-11 10:03:40 +01:00