test(composables): add specs for defineLocale, useKbd and useFormField - #262
Merged
Conversation
…d (c257686) Port the upstream composable specs. Adapted for b24ui: defineLocale fixtures pass the required `locale` field, and useFormField's error-state color assertion expects b24ui's `air-primary-alert` token. useKbd is verbatim. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
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.
Syncs upstream nuxt/ui commit
c257686— test(composables): add specs for defineLocale, useKbd and useFormField (#6701).What
Test-only — adds three composable specs. All three composables exist in b24ui with matching APIs; two specs needed small fork adaptations:
useKbd.spec.ts— verbatim. b24ui'skbdKeysMapand the macOS / non-macOSmeta/ctrl/altresolution match upstream exactly.defineLocale.spec.ts— addedlocale: 'en'to the fixture. b24ui'sDefineLocaleOptionsrequires alocalefield (a fork divergence — every b24ui locale definition passes it); upstream's fixture omits it, which would fail typecheck here.useFormField.spec.ts— the error-state assertion expectsair-primary-alertinstead oferror, because b24ui'suseFormFieldreturns that color token on field error. The rest of the API (id/name/size/highlight/disabled fallbacks,ariaAttrs, form events, debounced/deferred input) matches upstream.Verify (
CI=true)dev:prepare·lint·typecheck·test·build— all green. Suite 5411 passed / 6 skipped (+6 test files, 231→237). No snapshot changes.Ledger: cursor advanced to
c257686; previous entry5944067reconciled to PR #261.🤖 Generated with Claude Code
Generated by Claude Code