Wait with renderSettled in the renderComponent tests, not run() - #21657
Open
NullVoxPopuli-ai-agent wants to merge 1 commit into
Open
NullVoxPopuli-ai-agent wants to merge 1 commit into
NullVoxPopuli-ai-agent wants to merge 1 commit into
Conversation
The renderComponent tests wrapped each render, update and destroy in `run(() => ...)`. The tests now call the API directly and wait with `await renderSettled()`, as an application does. - `renderComponent()` renders synchronously. The test helper asserts the HTML immediately after the call, with no wait. - Each tracked update and each destroy is followed by `await renderSettled()`. - `AbstractStrictTestCase` no longer uses `runTask` and `runDestroy`. Only this test file extends that class. No test was added, removed or renamed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
|
I think this looks good -- best viewed with "Ignore whitespace" |
This branch has not been deployed
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.
render-component-test.tsno longer importsrun. Each test calls the API directly and waits withawait renderSettled(), as an application does.This is the first test file in the move away from
run(() => ...).Changes
run(() => renderComponent(...))renderComponent(...), then the HTML assertion with no wait. The render is synchronous.run(() => change())change(); await renderSettled();run(() => destroy(x))destroy(x); await renderSettled();runDestroy(this)inafterEachdestroy(this); await renderSettled();AbstractStrictTestCasechanges too. ItsafterEachandassertStableRerenderare now async and userenderSettled()in place ofrunDestroyandrunTask. Only this test file extends that class.No test was added, removed or renamed.
One test keeps its shape: "strict-mode components cannot lookup things in the registry".
template()throws at compile time, before the render call, soassert.throwsstays.Verification
renderComponentfilter: 45 pass in a development build, 43 pass in a production build, 2 skipped in each.await renderSettled()removed fromassertChangeand from one destroy test, 8 tests fail. The waits do real work.pnpm type-check:internals,eslintandprettierpass.Conflict with #21647
#21647 adds tests to this file that use
run. The PR that merges second needs an update.🤖 Generated with Claude Code