test(router): targeted tests for data-context and i18n (#275)#372
Merged
Conversation
#275 asks for targeted tests across protocol, ui, element, and router. protocol/ui/element already ship test files; router's runtime surface had two untested pure modules: - data-context.test.ts: render-scoped loader/action data stack — push/pop/peek contract, action-data association to the top frame, nested render scoping, empty-stack behavior, and the depth>10 warning guard. - i18n.test.ts: normalizeLocalePath — locale-prefix detection, default-locale fallback, localized-path construction, root path, and empty-locales list. Both are DOM-free; no production code changed. Closes #275
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Deploying openelement with
|
| Latest commit: |
d7d3c2d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://168d5973.lessjs.pages.dev |
| Branch Preview URL: | https://fix-275-targeted-tests.lessjs.pages.dev |
Contributor
|
APIError: Insufficient Balance |
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
#275 asked for targeted tests across
protocol,ui,element, androuter.On inspection,
protocol(errors,hydration-markers,render,vnode),ui(components/css-smoke/smoke/static-subpath), andelement(5 test files,including the runtime-module coverage added for #328) already ship test files.
The gap was
router's runtime surface:data-context.tsandi18n.tshad notests.
data-context.test.ts(7 tests): render-scoped loader/action data stack —push/pop/peek contract, action-data association to the top frame, nested render
scoping, empty-stack behavior, and the depth>10 warning guard.
i18n.test.ts(6 tests):normalizeLocalePath— locale-prefix detection,default-locale fallback, localized-path construction, root path, and empty
locales list.
Both modules are DOM-free pure logic, so no production code changed and no DOM
shim is required.
Test plan
deno teston both new files: 13 passed.deno fmt --check+deno lintclean.Closes #275