Skip to content

test: strengthen helper_identifier_hover_works_in_blade_embedded_php to assert card content - #144

Merged
mikebronner merged 2 commits into
mainfrom
chore/136-test-strengthen-helperidentifierhoverworksinbladee
Jun 15, 2026
Merged

mikebronner merged 2 commits into
mainfrom
chore/136-test-strengthen-helperidentifierhoverworksinbladee

Conversation

@mikebronner

@mikebronner mikebronner commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements #136 — strengthens helper_identifier_hover_works_in_blade_embedded_php so it asserts the rendered card content in the Blade-embedded-PHP context, not merely that a card exists. Follow-up from Holmes's review of PR #135 (AC #3 of #119 had pinned this test as unmodifiable, so it could only be touched here).

Changes

  • Replaced the bare hover::helper_identifier_card(&route.name, None).is_some() assertion with content assertions: card.contains("**route**") (the header) and card.contains("named route") (the route synopsis keyword).
  • The test still drives the Blade-embedded-PHP host path — parse_owned on nav.blade.php with route('home') inside a Blade {{ }} echo, finding the helper via helper_refs — so it now proves its own claim of host-file-type invariance.
  • Matches the content-assertion pattern already used by the sibling curated-helper hover tests.

Acceptance Criteria

  • Replaces the bare .is_some() assertion with card.contains("**route**") and card.contains("named route")
  • Continues to exercise the Blade-embedded-PHP host path (the route() call inside Blade {{ }}), not just a direct helper_identifier_card call
  • All other tests in the file remain green and unmodified
  • cargo test --lib --bins, cargo fmt --check, and cargo clippy pass with no new warnings

Test Plan

  • cargo fmt --check — clean
  • cargo clippy --lib --bins — no warnings
  • cargo test --lib --bins — 2041 tests pass (1747 + 294), 0 failures; all 8 helper_identifier_hover tests green including the strengthened one

Fixes #136

Replace the bare `.is_some()` assertion in
`helper_identifier_hover_works_in_blade_embedded_php` with content
assertions — `card.contains("**route**")` and the `route` synopsis
keyword `"named route"` — so a wrong or empty card can no longer pass.
The test now proves its own claim of host-file-type invariance rather
than merely asserting a card exists, matching the content-assertion
pattern used by the sibling curated-helper hover tests.

Fixes #136
@mikebronner
mikebronner marked this pull request as ready for review June 15, 2026 16:06

@mr-sherlock-holmes mr-sherlock-holmes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved

Review Summary

  • A focused test-only change (+9 −2) strengthening helper_identifier_hover_works_in_blade_embedded_php — exactly the follow-up #136 asked for.
  • AC #1 met — the bare hover::helper_identifier_card(&route.name, None).is_some() is replaced with content assertions card.contains("**route**") and card.contains("named route"). Both strings are confirmed present in the real card: the header is built as format!("**{}**", h) (hover.rs:126) and the route synopsis is "Generate a URL for a named route." (hover.rs:249), pinned by hover/tests.rs:428.
  • AC #2 met — the Blade-embedded-PHP host path is still exercised end to end: parse_owned on nav.blade.php with {{ route('home') }}, resolved via data.helper_refs (the Blade-extraction field), not a shortcut.
  • AC #3 met — the diff is a single hunk inside the one function; every sibling test is untouched.
  • AC #4 met — CI is all green (LSP — test, fmt, clippy; Extension — wasm/fmt/clippy).

What's Good

  • The new assertions are meaningful discriminators, not trivia — named route is distinctive to the route synopsis and absent from the other six curated helpers, and **route** rules out a wrong-helper card. A wrong or empty card now fails, which was the whole point.
  • The assertion pair mirrors the established every_curated_helper_renders_its_own_card convention exactly (("route", "named route")), so the strengthened test reads as a natural extension of the file's pattern.
  • The .expect(...) message documents why a None would be a genuine regression rather than masking one.

📋 Non-blocking follow-ups

  • None.

Ready for @mikebronner to merge.

@mikebronner
mikebronner merged commit 74065f9 into main Jun 15, 2026
5 checks passed
@mikebronner
mikebronner deleted the chore/136-test-strengthen-helperidentifierhoverworksinbladee branch June 15, 2026 16:59
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.

test: strengthen helper_identifier_hover_works_in_blade_embedded_php to assert card content

1 participant