Skip to content

Trim cross-file redundancies in the strict-resolver tests#21332

Closed
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:nvp/strict-resolver-rfc-1132from
NullVoxPopuli-ai-agent:trim-redundant-resolver-tests-2
Closed

Trim cross-file redundancies in the strict-resolver tests#21332
NullVoxPopuli-ai-agent wants to merge 1 commit intoemberjs:nvp/strict-resolver-rfc-1132from
NullVoxPopuli-ai-agent:trim-redundant-resolver-tests-2

Conversation

@NullVoxPopuli-ai-agent
Copy link
Copy Markdown
Contributor

Summary

After the last trim of basic-test.js, three cross-file overlaps remain across the four resolver test files:

File Redundancy Covered already by
registry_test.ts resolves shorthand modules (without default wrapper) basic-test's shorthand edge-case tests + resolves modules provided via modules property (proves Application integration)
registry_test.ts resolves router:main via ./router module basic-test's \type:main` resolves to the unpluralized `type` module key` (router:main is registered by Ember itself, not strict-resolver specific)
strict-resolver-test.ts gjs component resolves from modules sub-route with nested model — both visit /posts and inspect [data-test=post-card]; folded the h2 check in
strict-resolver-substates-test.ts visiting /posts renders the list sub-route with nested model in strict-resolver-test.ts
strict-resolver-substates-test.ts visiting a nested dynamic sub-route renders the detail template dynamic segment sub-route in strict-resolver-test.ts

Removing those two substates tests also lets us drop the now-unused scaffolding (router entry, routes/posts.js, routes/posts/show.js, templates/posts.hbs, templates/posts/show.hbs) — the substates scenario should focus on loading/error state behavior, which is what strict-resolver-substates-test is named for.

Result

  • registry_test.ts: 4 tests → 2 tests, −34 lines
  • strict-resolver-test.ts: folded 2 tests into 1, −10 lines
  • strict-resolver-substates-test.ts: 5 tests → 3 tests + removed dead scaffolding, −41 lines

Net: −85 lines, identical coverage.

Test plan

  • pnpm test --filter strict passes all three scenarios (strictResolver-basics, strictResolver-strict-resolver, strictResolver-strict-resolver-substates)
  • pnpm type-check:internals, pnpm lint:eslint, pnpm prettier --check all clean
  • CI

🤖 Generated with Claude Code

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>
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.

2 participants