fix: repair cross-package bugs so all tests and type checks pass#64
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and type checks pass#64stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- utils/date: use en-AU dateStyle:"short" so day 1 isn't confused with month 1 (was forcing M/D order via explicit numeric fields) - ui/Button: forward aria-label to the button element for icon-only buttons - ui/DataTable: fix stale-closure in sort toggle via functional setState updater - web/api: update rename useThrottle -> useDebounce from @e2e/utils - ui/test: add triple-slash bun-types reference so bun:test resolves under tsc without narrowing production global types
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
Fixes all failing tests and type errors across the monorepo. Bugs spanned three packages (
packages/utils,packages/ui,apps/web). Final state: 13/13 tests pass,tsc --noEmitreports 0 errors.Bugs fixed
packages/utils/src/format/date.ts—formatDatepassed explicitmonth/day/yearnumeric fields toIntl.DateTimeFormat, which forced M/D/YYYY ordering (01/03/2024). Replaced withdateStyle: "short"so theen-AUlocale drives DD/MM ordering and drops the leading zero on the day — 1 March is now1/03/2024, not confused with month 1.packages/ui/src/components/Button/Button.tsx— thearia-labelprop was never forwarded to the<button>element for icon-only buttons. Now applied so the accessibility test passes.packages/ui/src/components/DataTable/DataTable.tsx— stale-closure in the sort-direction toggle. Switched to a functionalsetStateupdater (prev => ...) so a controlled re-render toggles correctly.apps/web/src/lib/api.ts— importeduseThrottle, which was renamed touseDebouncein@e2e/utils(same(value, delay)signature). Updated the import and re-export, preserving theas useSearchDebouncealias.Tooling
packages/ui/test/globals.d.ts(new) — a triple-slash/// <reference types="bun-types" />sobun:testresolves undertsc. This augments globals for the compilation without an explicittypesarray on the root tsconfig, which would have silently narrowed DOM/React/Node globals for production source.Assumptions
bun test(React component tests require the happy-dom preload frompackages/ui/test/setup.ts) andtsc --noEmit; both are clean.bun-typeswas already installed.en-AUdateStyle:"short"is the intended locale/format (day without leading zero, zero-padded month) as required by the date tests.Verification