test: add HTMLDraftman direct visitor tests #19

Merged
thib8956 merged 1 commits from issue-10/html-draftman-tests into master 2026-03-27 17:05:38 +00:00
Owner

Summary

  • Add 32 unit tests for HTMLDraftman, testing each visit*() method in isolation with @Nested test classes.
  • Covers rectangle, circle, triangle, text, and collection visitors with attribute combinations (filled/stroked/both/neither), CSS positioning, id/class consistency between HTML and CSS output, and generateHTML wrapper.
  • Includes a regression test for the visitTriangle() hashCode bug (this.hashCode() vs sTriangle.hashCode()) as noted in the issue.
  • All 68 tests pass (32 new + 36 existing).

Closes #10

## Summary - Add 32 unit tests for `HTMLDraftman`, testing each `visit*()` method in isolation with `@Nested` test classes. - Covers rectangle, circle, triangle, text, and collection visitors with attribute combinations (filled/stroked/both/neither), CSS positioning, id/class consistency between HTML and CSS output, and `generateHTML` wrapper. - Includes a **regression test** for the `visitTriangle()` hashCode bug (`this.hashCode()` vs `sTriangle.hashCode()`) as noted in the issue. - All 68 tests pass (32 new + 36 existing). Closes #10
thib8956 added 1 commit 2026-03-27 17:02:20 +00:00
test: add HTMLDraftman direct visitor tests
All checks were successful
CI / build-and-test (pull_request) Successful in 18s
d3c993eb2d
Add 32 tests covering each visit*() method in isolation:
- visitRectangle: div+id, position, dimensions, filled/stroked/both/neither
- visitCircle: div+class, border-radius prefixes, position, id consistency
- visitTriangle: div+class, CSS border trick, position, fill color,
  regression test for hashCode mismatch (this.hashCode vs shape.hashCode)
- visitText: content, id consistency, position, font attrs, color, nowrap,
  null color fallback
- visitCollection: empty, multiple children, nested
- generateHTML: DOCTYPE, structure, stylesheet ref, shape content

Closes #10
thib8956 force-pushed issue-10/html-draftman-tests from d744588f25 to d3c993eb2d 2026-03-27 17:02:20 +00:00 Compare
thib8956 merged commit 8d56e941fc into master 2026-03-27 17:05:38 +00:00
thib8956 deleted branch issue-10/html-draftman-tests 2026-03-27 17:05:38 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: thib8956/new-shapes#19