Vereinfacht fixes, test cleanup, and dev seed improvements #467

Merged
moritz merged 7 commits from fix/small_fixes into main 2026-03-10 20:42:11 +01:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Fixes production and accessibility issues (Vereinfacht client, WCAG contrast), cleans up skipped/obsolete tests, and improves dev seeds (fee type distribution, exit dates).


What has been changed?

Bugfixes

  • Vereinfacht client (production): Mix.env/0 was called at runtime in req_http_options/0, which is not available in releases. It is now evaluated at compile time via a module attribute (@env), so production no longer crashes when using the Vereinfacht API.
  • Vereinfacht notice (accessibility): The “No Vereinfacht contact” warning on the member membership-fees view used text-warning, which did not meet WCAG 2 AA contrast. It now uses the existing text-warning-aa class for sufficient contrast in light and dark theme.

Test cleanup (refactoring)

  • Profile navigation: Re-enabled the avatar test; it now asserts the current behaviour (first letter of email) and uses an admin user so the test can access /.
  • CheckPagePermission: Removed three skipped full-router integration tests for “linked member” access; the plug behaviour is already covered by unit tests, and the skipped tests failed because the session does not preserve member_id.
  • Group show authorization: Removed the skipped placeholder test “non-existent member IDs are handled” (it did not assert invalid-ID behaviour).
  • Custom field slug: Removed the skipped “can find custom field by slug” test and the “future feature” describe block; slug-based lookup is not implemented.

Seeds (dev data)

  • Fee type distribution: All 20 dev members now get a membership fee type via round-robin (each of the 5 types used 4 times). The fee type is set in the initial create attributes to avoid “only same-interval changes allowed” when generating cycles.
  • Exit dates: Five members (indices 3, 7, 11, 15, 19) get an exit_date set to one year after their join_date.

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed (run just ci-dev to confirm)
  • Documentation is added where needed (comments in code where useful)

Accessibility

  • New elements are properly defined with html-tags (no new UI elements; existing warning text class changed)
  • Colour contrast follows WCAG criteria (Vereinfacht warning uses text-warning-aa)
  • Aria labels are added when needed (unchanged)
  • Everything is accessible by keyboard (unchanged)
  • Tab-Order is comprehensible (unchanged)
  • All interactive elements have a visible focus (unchanged)

Testing

  • Tests for new code are written (N/A; changes are fixes and test cleanup)
  • All tests pass (run full suite / just ci-dev)
  • axe-core dev tools show no critical or major issues (manual check if required)

Additional Notes

  • Vereinfacht: The fix is in lib/mv/vereinfacht/client.ex; no config or env changes needed.
  • Seeds: Re-running seeds on an existing DB that already has members with cycles may still hit interval validations on upsert; for a clean state use mix ecto.reset then run seeds again.
  • Skipped tests: One skipped test remains: “empty CSV shows error” in import_live_test.exs, due to LiveView test harness limitations with empty file uploads (see docs/csv-member-import-v1.md).
## Description of the implemented changes The changes were: - [x] Bugfixing - [ ] New Feature - [ ] Breaking Change - [x] Refactoring Fixes production and accessibility issues (Vereinfacht client, WCAG contrast), cleans up skipped/obsolete tests, and improves dev seeds (fee type distribution, exit dates). --- ## What has been changed? **Bugfixes** - **Vereinfacht client (production):** `Mix.env/0` was called at runtime in `req_http_options/0`, which is not available in releases. It is now evaluated at compile time via a module attribute (`@env`), so production no longer crashes when using the Vereinfacht API. - **Vereinfacht notice (accessibility):** The “No Vereinfacht contact” warning on the member membership-fees view used `text-warning`, which did not meet WCAG 2 AA contrast. It now uses the existing `text-warning-aa` class for sufficient contrast in light and dark theme. **Test cleanup (refactoring)** - **Profile navigation:** Re-enabled the avatar test; it now asserts the current behaviour (first letter of email) and uses an admin user so the test can access `/`. - **CheckPagePermission:** Removed three skipped full-router integration tests for “linked member” access; the plug behaviour is already covered by unit tests, and the skipped tests failed because the session does not preserve `member_id`. - **Group show authorization:** Removed the skipped placeholder test “non-existent member IDs are handled” (it did not assert invalid-ID behaviour). - **Custom field slug:** Removed the skipped “can find custom field by slug” test and the “future feature” describe block; slug-based lookup is not implemented. **Seeds (dev data)** - **Fee type distribution:** All 20 dev members now get a membership fee type via round-robin (each of the 5 types used 4 times). The fee type is set in the initial create attributes to avoid “only same-interval changes allowed” when generating cycles. - **Exit dates:** Five members (indices 3, 7, 11, 15, 19) get an `exit_date` set to one year after their `join_date`. --- ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed *(run `just ci-dev` to confirm)* - [x] Documentation is added where needed *(comments in code where useful)* ### Accessibility - [x] New elements are properly defined with html-tags *(no new UI elements; existing warning text class changed)* - [x] Colour contrast follows WCAG criteria *(Vereinfacht warning uses `text-warning-aa`)* - [x] Aria labels are added when needed *(unchanged)* - [x] Everything is accessible by keyboard *(unchanged)* - [x] Tab-Order is comprehensible *(unchanged)* - [x] All interactive elements have a visible focus *(unchanged)* ### Testing - [x] Tests for new code are written *(N/A; changes are fixes and test cleanup)* - [x] All tests pass *(run full suite / `just ci-dev`)* - [x] axe-core dev tools show no critical or major issues *(manual check if required)* --- ## Additional Notes - **Vereinfacht:** The fix is in `lib/mv/vereinfacht/client.ex`; no config or env changes needed. - **Seeds:** Re-running seeds on an existing DB that already has members with cycles may still hit interval validations on upsert; for a clean state use `mix ecto.reset` then run seeds again. - **Skipped tests:** One skipped test remains: “empty CSV shows error” in `import_live_test.exs`, due to LiveView test harness limitations with empty file uploads (see docs/csv-member-import-v1.md).
moritz self-assigned this 2026-03-10 20:20:46 +01:00
moritz added 7 commits 2026-03-10 20:20:47 +01:00
moritz added this to the Sprint 13: 19.02-26.02 project 2026-03-10 20:20:49 +01:00
moritz force-pushed fix/small_fixes from bb1a80ad08 to 5eb7c9c4b2 2026-03-10 20:36:23 +01:00 Compare
moritz merged commit f19b44f6a3 into main 2026-03-10 20:42:11 +01:00
moritz deleted branch fix/small_fixes 2026-03-10 20:42:13 +01:00
Sign in to join this conversation.
No description provided.