Remove dead code and tests that cannot fail closes #605 #608

Merged
simon merged 16 commits from issue/mitgliederverwaltung-605 into main 2026-10-19 12:44:35 +02:00
Owner

closes #605

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Remove dead code and tests that cannot fail: production code without a caller is removed (the unused email confirmation flow, uncalled functions, read actions and code interfaces, the CalendarCycles today-wrappers), a new guideline requires at least one caller per code interface, and the tests in every touched file now fail when the behaviour they name breaks — each changed test was seen red under a targeted break, and duplicates subsumed by a stricter sibling are deleted.

What has been changed?

  • Add assertions that pin flash and field errors to their element
  • Translate the current OIDC user_info error and drop stale error entries
  • Remove the unused new-user email confirmation flow
  • Remove functions, actions and helpers no code path calls
  • Remove the uncalled CalendarCycles today-wrappers and last_completed_cycle?
  • Remove test helpers no test calls
  • Run member, group, role and OIDC tests through the paths the app uses
  • Require a caller for every code interface and remove those without one
  • State why CycleGenerationJob and open_amount_total/1 have no production caller yet
  • Describe how expired join requests are actually cleaned up
  • Pin group page and validation assertions to their elements and drop duplicate tests
  • Pin members page, column and sort assertions to their elements
  • Assert field status in each datafield row and refute the real section titles
  • Pin role page assertions to their elements and drop duplicate tests
  • Assert exact parser and import results and drop duplicate tests
  • Tighten system actor, policy, constraint and fee helper assertions

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

The review loop hit its cap of 4 iterations; every iteration found further instances of the same two test classes (cannot fail, redundant) in pre-existing tests of the touched files, all fixed. Remaining instances and the same classes in untouched test files are collected for follow-up issues.
Larger commits: remove the email confirmation flow (14 files), run tests through the app's paths (14 files), and the test hardening commits for groups (6 files, −607), members page (5 files, −625), import (−223) and domain-level tests (8 files, −315).
Handed over, not touched here: the FieldSelection cookie/session functions (#549), button :active (#602), dropdown_menu :menu_class, table :row_value_id, Layouts.app :current_scope, the phx:set-input-value listener (#554), the SMTP warning test (#540), CustomField :prepare_deletion with its interface, and the gettext #~ entries.
The test count drops from 2621 to 2556: deleted tests were subsumed by a stricter sibling.

closes #605 ## Description of the implemented changes The changes were: - [ ] Bugfixing - [ ] New Feature - [ ] Breaking Change - [x] Refactoring Remove dead code and tests that cannot fail: production code without a caller is removed (the unused email confirmation flow, uncalled functions, read actions and code interfaces, the CalendarCycles today-wrappers), a new guideline requires at least one caller per code interface, and the tests in every touched file now fail when the behaviour they name breaks — each changed test was seen red under a targeted break, and duplicates subsumed by a stricter sibling are deleted. ## What has been changed? - Add assertions that pin flash and field errors to their element - Translate the current OIDC user_info error and drop stale error entries - Remove the unused new-user email confirmation flow - Remove functions, actions and helpers no code path calls - Remove the uncalled CalendarCycles today-wrappers and last_completed_cycle? - Remove test helpers no test calls - Run member, group, role and OIDC tests through the paths the app uses - Require a caller for every code interface and remove those without one - State why CycleGenerationJob and open_amount_total/1 have no production caller yet - Describe how expired join requests are actually cleaned up - Pin group page and validation assertions to their elements and drop duplicate tests - Pin members page, column and sort assertions to their elements - Assert field status in each datafield row and refute the real section titles - Pin role page assertions to their elements and drop duplicate tests - Assert exact parser and import results and drop duplicate tests - Tighten system actor, policy, constraint and fee helper assertions ## Definition of Done ### Code Quality - [ ] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [ ] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [ ] axe-core dev tools show no critical or major issues ## Additional Notes The review loop hit its cap of 4 iterations; every iteration found further instances of the same two test classes (cannot fail, redundant) in pre-existing tests of the touched files, all fixed. Remaining instances and the same classes in untouched test files are collected for follow-up issues. Larger commits: remove the email confirmation flow (14 files), run tests through the app's paths (14 files), and the test hardening commits for groups (6 files, −607), members page (5 files, −625), import (−223) and domain-level tests (8 files, −315). Handed over, not touched here: the `FieldSelection` cookie/session functions (#549), `button :active` (#602), `dropdown_menu :menu_class`, `table :row_value_id`, `Layouts.app :current_scope`, the `phx:set-input-value` listener (#554), the SMTP warning test (#540), `CustomField :prepare_deletion` with its interface, and the gettext `#~` entries. The test count drops from 2621 to 2556: deleted tests were subsumed by a stricter sibling.
An interface only tests call keeps an API alive that the app never
exercises, so its tests pass while the real path can break unnoticed.
test(membership): tighten system actor, policy, constraint and fee helper assertions
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
f6b97d2c03
simon merged commit a662fe40bd into main 2026-10-19 12:44:35 +02:00
simon deleted branch issue/mitgliederverwaltung-605 2026-10-19 12:44:35 +02:00
Sign in to join this conversation.
No description provided.