Skip to content

Add feature test coverage for home + PDF endpoints#113

Open
anchovie91471 wants to merge 1 commit into
mainfrom
chore/feature-tests
Open

Add feature test coverage for home + PDF endpoints#113
anchovie91471 wants to merge 1 commit into
mainfrom
chore/feature-tests

Conversation

@anchovie91471
Copy link
Copy Markdown
Collaborator

@anchovie91471 anchovie91471 commented May 16, 2026

Summary

Establishes a minimal feature-test safety net before the Laravel 12 upgrade (PR-2) so the verification signal there isn't purely manual smoke. PR-2 will be the upgrade. 2 PRs to make review easier.

11 tests, 53 assertions, all green locally:

File Coverage
tests/Feature/SmokeTest.php artisan about + package:discover boot. Reproduces the symptom PR #112 fixed; doubles as a regression net for future symfony bumps.
tests/Feature/HomeTest.php Inertia screen 1, screen 2 (fixture-backed JSON fetch), and screen-1-on-error.
tests/Feature/PdfTest.php Default download, all 3 grouping strategies (via #[DataProvider]), CJK language path (Noto JP font), and Google Sheets source.

All outbound HTTP faked via Http::fake() — tests run offline and deterministic with no network or GOOGLE_API_KEY requirement.

Fixture (tests/Fixtures/meetings.json)

Hand-crafted to exercise specific code paths:

  • 25 meetings across all 7 days
  • 4 hierarchical regions (Mississippi > North/South > Tupelo/Oxford/Jackson/Gulfport) + 4 flat city/state entries (Memphis TN, New Orleans LA) — exercises both branches of extractRegions() (Controller.php:154-188)
  • 10 distinct type codes (O, C, D, B, ST, M, W, BE, ONL, TC) — every value the legend renders
  • 2 TC meetings that exercise the "Temporarily Closed" filter at Controller.php:540 (previously untested)
  • 1 CJK name (朝の集い) for the Noto JP font path

Establishes a minimal feature-test safety net before the Laravel 12
upgrade so the verification signal isn't purely manual smoke.

Coverage (11 tests, 53 assertions):
- SmokeTest: artisan about + package:discover boot checks. These
  reproduce the symptom that PR #112 fixed and double as a regression
  net for any future symfony bump.
- HomeTest: Inertia screen 1, screen 2 (with fixture-backed JSON
  fetch), and screen-1-on-error paths.
- PdfTest: default download, all three grouping strategies (via
  DataProvider), CJK language path (Noto JP font), and Google Sheets
  source (the URL transform at Controller.php:39 routes through
  sheets.googleapis.com so Http::fake matches the outbound URL).

All outbound HTTP is faked via Http::fake — tests are offline and
deterministic. The fixture (tests/Fixtures/meetings.json) is
hand-crafted to hit explicit cardinality requirements: 25 meetings
across all 7 days, 4 hierarchical regions + 4 flat city/state entries,
10 distinct type codes including 2 TC meetings that exercise the
"Temporarily Closed" filter at Controller.php:540 (previously
untested), and 1 CJK name for the Noto JP font path.

Tests use PHP 8 attributes (#[Test], #[DataProvider]) for forward
compatibility with PHPUnit 11 (PR-3).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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