Skip to content

Test hardening: enablement rules with mocked view and geometry assertions #15

Merged
phomarkon merged 6 commits into
developfrom
phongsakon/feature/test-hardening
Jun 11, 2026
Merged

Test hardening: enablement rules with mocked view and geometry assertions #15
phomarkon merged 6 commits into
developfrom
phongsakon/feature/test-hardening

Conversation

@phomarkon

@phomarkon phomarkon commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Adds a test-double layer for the align/distribute enablement rules that the pure-geometry tests don't cover:

  • ActionEnablementTest — mocks DrawingView/DrawingEditor to verify align enables at ≥2 figures and distribute enables at ≥3 figures, without a live Swing editor.
  • Defensive assert guards in AlignAction (non-null delta) and Distribution (non-null boxes, correct length, outermost anchors preserved).
  • Adds mockito-core 4.11.0 as a test-scoped dependency.

Closes the "enabled-state" acceptance criterion from the user story.

phomarkon and others added 6 commits May 31, 2026 11:52
Added JUnit 4 next to the existing TestNG so the lab's framework is in
place without disturbing the current tests. The tests cover the pure
geometry the refactoring exposed: 9 cases for Alignment, one per
direction plus the already-aligned and oversized-figure boundaries, and
6 for Distribution, the equal-gap best case plus the two and one figure
boundaries where it must do nothing. All 15 green.
Mapped the user story to Given-When-Then scenarios with JGiven and
AssertJ. One stage holds the steps, and the three scenarios cover the
story's promises: aligning north lines up the top edges, distributing
makes the gaps equal, and distributing two figures changes nothing.
GitHub Actions pipeline that builds all modules and runs the tests on
JDK 11 for every pull request. Named ci-align.yml so it does not clash
with the ci.yml a teammate added on another branch.
…stribute

Phongsakon/feature/test align distribute
@phomarkon phomarkon merged commit bde35f6 into develop Jun 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant