Repository navigation
[CLEANUP] Render tests through a Glimmer root component - #21775
Merged
ef4 merged 3 commits intoNov 3, 2026
Merged
Conversation
`RenderingTestCase` and `RouterNonApplicationTestCase` used a classic
`Component` as the `this` of each test template. The class is going to
be deleted, and the harness must not depend on it.
The root is now a Glimmer component. It keeps `get`, `set` and
`rerender`, so tests that change the context stay the same.
The render option `dynamicScope` is private. The default scope of a
component root does not pass `view` to its children, so nested classic
components lose `parentView` without it.
Tests that read the classic root now do one of these:
- Life-cycle tests render below a real classic parent.
- Other tests assert the relation between their own components.
- The stack label for a root is `{ROOT}`, as for the root outlet.
- Cache counters no longer count the classic root.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| state: RendererState, | ||
| definition: object, | ||
| options: { into: Cursor; args?: Record<string, unknown> } | ||
| options: { into: Cursor; args?: Record<string, unknown>; dynamicScope?: DynamicScope } |
Contributor
There was a problem hiding this comment.
at least this isn't renderComponent
`ClassicRenderingTestCase` renders through the classic top-level component, as the harness did before. The classic tests that read that root use it again, with their original assertions. New tests in `components/classic/` cover what the rest of the suite no longer reaches: - Recovery after an error in the initial render. - The `-top-level` label in a backtracking message. - The template cache counters below a classic root. - `action()` in the context of a classic root. `templateCacheHits: 0` stays in the runtime resolver cache test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Glimmer root of the test harness now uses the default dynamic scope of renderComponent, like an application does. The private dynamicScope option of BaseRenderer.render is gone. Ember's DynamicScope exists only below a classic root from appendTo. Three tests read it, so they render through ClassicRenderingTestCase: - yield should not introduce a view, which reads parentView - the two -with-dynamic-var tests that expect the assertion for a key other than outletState Co-Authored-By: Claude Opus 5.5 <[email protected]>
ef4
approved these changes
Nov 3, 2026
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.
Test templates now render through a Glimmer component, not a classic
Component. This lets #21630 deprecate the class with no exception for the test harness.What changes
RenderingTestCaseandRouterNonApplicationTestCaserender throughTopLevelComponent, a new@glimmer/componentclass ininternal-test-helpers.get,setandrerender, so about 180this.context.set(...)calls stay the same.renderComponent, the same as an application. There are no production changes.Test changes
ClassicRenderingTestCaseintests/utilsrenders through the classic top-level component, as the harness did before.DynamicScopeexists only below a classic root fromappendTo. Tests that read it useClassicRenderingTestCase, with their original assertions:components/classic/: angle bracket, curly, dynamic, life-cycle, and error handling. They assert onparentViewandchildViews.classic/yield-test.js, which readsparentView.{{-with-dynamic-var}}tests that expect the assertion for a key other thanoutletState.{ROOT}, the same as the root outlet.templateCacheHits: 0stays in the test.<Input>tests use an arrow function, becauseaction()in the context needs a classic class.New classic tests
8 new tests in
components/classic/keep the coverage that the Glimmer root no longer reaches:-top-levellabel in a backtracking message.action()in the context of a classic root, in 3<Input>tests.Coverage that is gone
append-test.jsand the five files above still use that path.setPropertiesandincrementPropertycalls on the root in three tests. The root was not the subject of those tests.Verified locally
All 9 CI variants pass. The default run has 9269 tests, which is
mainplus the 8 new classic tests.pnpm lint, alltype-checkscripts,pnpm build, andpnpm lint:docspass.🤖 Generated with Claude Code