Fill the nested-route gaps in the strict-resolver scenario#21333
Merged
NullVoxPopuli merged 2 commits intoemberjs:nvp/strict-resolver-rfc-1132from Apr 21, 2026
Merged
Conversation
After the basic-test.js cleanup, three cross-file overlaps remain.
None change coverage — each dropped case is already asserted by
another test.
registry_test.ts:
- `resolves shorthand modules (without default wrapper)` is already
covered by basic-test's three shorthand-edge-case tests, and the
Application integration is already proven by `resolves modules
provided via modules property` just above it.
- `resolves router:main via ./router module` just re-checks the
mainLookup path that basic-test covers via `\`type:main\` resolves
to the unpluralized \`type\` module key`; router:main is
registered by Ember itself, not by the strict resolver.
strict-resolver-test.ts:
- `gjs component resolves from modules` and `sub-route with nested
model` both visit `/posts` and inspect `[data-test=post-card]`.
Folded the h2-exists assertion into the count test and dropped
the standalone gjs test.
strict-resolver-substates-test.ts:
- `visiting /posts renders the list` and `visiting a nested dynamic
sub-route renders the detail template` repeat what
strict-resolver-test.ts already checks; the substates scenario
should focus on loading/error state behaviour.
- Removed the now-unused posts/show scaffolding (router entry,
routes/posts.js, routes/posts/show.js, templates/posts.hbs,
templates/posts/show.hbs) to keep the scenario app minimal.
Net: −85 lines across three files, no loss of coverage. All three
strict-resolver smoke scenarios still pass locally.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The existing tests exercise a two-level nested route (`posts.show`
via `/posts/42`) but only assert the child template renders. Three
concrete gaps:
1. The parent template isn't asserted to render alongside the
child — a bug where the parent's `{{outlet}}` silently broke
would pass.
2. There's no `templates/posts/index.hbs`, so we don't prove the
resolver can walk `template:posts.index` ->
`templates/posts/index` (the `name.index -> name/index` nested
folder path).
3. No 3-level nesting coverage, so a regression in the
`type:a.b.c -> a/b/c` normalization wouldn't be caught.
Changes:
- Add `this.route('comments')` under `posts.show` and the matching
`routes/posts/show/comments.js` + `templates/posts/show/comments.hbs`.
Give `posts/show.hbs` a `{{outlet}}` so the grandchild has
somewhere to render.
- Add a `templates/posts/index.hbs`.
- Promote the two sub-route tests to also check that the parent
template is still in the DOM (post-cards + `[data-test="posts"]`).
- Add a new "three-level nested route resolves every level" test
that visits `/posts/42/comments` and asserts all three templates
(posts.hbs, posts/show.hbs, posts/show/comments.hbs) resolved
and rendered.
No resolver changes. All three strict-resolver smoke scenarios still
pass locally.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8bdd546
into
emberjs:nvp/strict-resolver-rfc-1132
41 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #21332 (trim-redundant-resolver-tests-2). The existing strict-resolver smoke test exercises a two-level nested route via
/posts/42, but only asserts the child template rendered. Three concrete gaps:posts.hbs's{{outlet}}stopped propagating@modelor the parent route stopped activating would pass today.templates/posts/index.hbs, so we don't prove the resolver walkstemplate:posts.index→templates/posts/index(thename.index → name/indexnested-folder path).type:a.b.c → a/b/cnormalization path would slip through.Changes
this.route('comments')underposts.showin the router, plusroutes/posts/show/comments.jsandtemplates/posts/show/comments.hbs. Giveposts/show.hbsa{{outlet}}so the grandchild has somewhere to render.templates/posts/index.hbsso theposts.indextemplate path is actually resolvable.three-level nested route resolves every level— visits/posts/42/commentsand checks all three levels ([data-test="posts"],[data-test="post-detail"],[data-test="post-comments"] li) are in the DOM.No resolver changes. One file changed (
smoke-tests/scenarios/strict-resolver-test.ts, +57/−3).Test plan
pnpm test --filter strictpasses all three scenarios (strictResolver-basics,strictResolver-strict-resolver,strictResolver-strict-resolver-substates)pnpm type-check:internals,pnpm prettier --checkclean🤖 Generated with Claude Code