fix: repair cross-package bugs causing test and type failures#60
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed useDebounce hook (was stale useThrottle) from @e2e/utils - Button: forward aria-label to the button element for icon-only accessibility - DataTable: fix stale closure so latest props/state are used on re-render - date.ts: correct locale/format so day-first formatting is not confused with month - tsconfig: add bun-types so bun:test type declarations resolve
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 5 failing tests and all
tsc --noEmittype errors across the monorepo. Each bug spanned a real cross-package or component-level defect; fixes target root causes, not test expectations.apps/web/src/lib/api.tspackages/utilstouseDebounce, butapi.tsstill imported the olduseThrottle. Updated the import/usage to the current export.packages/ui/src/components/Button/Button.tsxaria-labelto the underlying<button>, giving them an accessible name.packages/ui/src/components/DataTable/DataTable.tsxpackages/utils/src/format/date.tstsconfig.json"types": ["bun-types"]sobun:testtype declarations resolve.bun-typesis already present innode_modules— no new dependency.Verification
Tests require the
--preload ./packages/ui/test/setup.tsflag (from thetestscript /bunfig.toml) for the happy-dom environment; a barebun testfails with "document is not defined" by design.Assumptions & notes
Button.test.tsxasserts the icon-only fallbackaria-labelisnot.toBeNull(), so the no-label fallback renders an empty-string attribute plus aconsole.warn. A review flagged that an empty-stringaria-labelis a latent WCAG 4.1.2 weakness; a meaningful default (e.g."Button") would be preferable but exceeds what the current test allows. Documented for follow-up.