fix: resolve cross-package test failures and type errors#37
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: update stale import (useThrottle -> useDebounce) after hook rename - date.ts: use dateStyle 'short' so locale controls D/M/Y ordering - Button.tsx: apply aria-label for icon-only buttons (a11y) - DataTable.tsx: fix stale-closure sort toggle via functional setState updater - bunfig.toml: preload packages/ui test setup so component tests get a DOM - tsconfig.json: add bun-types so tsc resolves bun:test globals
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
packages/utils,packages/ui, andapps/web. All changes are minimal and targeted; no test files were modified and no dependencies were added.Final state:
bun test→ 13 pass / 0 fail,bunx tsc --noEmit→ 0 errors.Fixes
apps/web/src/lib/api.ts) —useThrottlewas renamed touseDebounceinpackages/utils; the consumer still imported the old name. Updated the import to match the real export (re-exported asuseSearchDebounce).packages/utils/src/format/date.ts) — explicit field options forcedM/D/YYYYordering regardless of locale. Switched todateStyle: "short"so the locale controls D/M/Y ordering (e.g.1 March 2024→1/3/..., not3/1/...).packages/ui/src/components/Button/Button.tsx) — icon-only buttons now applyaria-label, as asserted by the Button test.packages/ui/src/components/DataTable/DataTable.tsx) — sort-direction toggle captured a stale value; replaced with a functionalsetStateupdater so it always reads committed state. Caught by a controlled re-render test.bunfig.toml) — rootbun testdid not load a DOM environment, so component tests threwdocument is not defined. Wired the root config to preload the existingpackages/ui/test/setup.ts.tsconfig.json) — addedbun-typestotypessotscresolves thebun:testglobals used in test files (type declarations were already installed; no new dependency).Assumptions
bun-typeswere already present/installed, so wiring them required no new dependencies.Testing
bun testfrom repo root: 13 pass, 0 failbunx tsc --noEmitfrom repo root: 0 errors