yegor256/takes
Refactor TkHtmlTest to improve structure and edge case coverage (relates to #1408)
Aberta
#1.435 aberto em 24 de jul. de 2025
enhancementhelp wanted
Métricas do repositório
- Stars
- (875 estrelas)
- Métricas de merge de PR
- (Mesclagem média 95d 2h) (22 fundiu PRs em 30d)
Description
Improve and Refactor TkHtmlTest for Maintainability and Coverage (related to #1408)
The current implementation of TkHtmlTest can be improved in the following ways:
-
Duplication: Each test manually builds a nearly identical expected response using
Joined(..., body). This can be extracted into a helper method or reused variable. -
Edge Cases Missing:
- No tests for null or empty input.
- No assertion that
Content-TypeandContent-Lengthheaders are semantically correct (not just matched by string).
-
Structure Validation:
- Could add a test to verify that the body actually starts/ends with
<html>tags to ensure semantic HTML is passed.
- Could add a test to verify that the body actually starts/ends with
-
Test Readability:
- Introduce
@DisplayNameannotations or comment grouping to make intent clearer.
- Introduce
A can provide a PR if the maintainers agree.