Skip to content

[FIX] button tests and tooling config alignment - #142

Merged
egdev6 merged 1 commit into
mainfrom
fix/config
Apr 23, 2026
Merged

egdev6 merged 1 commit into
mainfrom
fix/config

Conversation

@andresito87

Copy link
Copy Markdown
Contributor

Summary

Fixes the current mismatch between Button accessibility test expectations and the project test/tooling configuration.

Closes #141

Type of change

  • 🧩 New component
  • 🐛 Bug fix
  • 🎨 Design tokens
  • ♿ Accessibility
  • 🏗️ Infrastructure
  • 📚 Documentation

Component checklist (skip if not applicable)

  • Follows the 5-file structure (types.ts, use*.ts, Component.tsx, index.ts, *.stories.tsx)
  • CVA variants defined in types.ts, not inline
  • No hardcoded colors — uses tokens from theme.css
  • No any types — TypeScript strict
  • ARIA attributes present and correct
  • Keyboard navigable (Tab, Enter, Escape where applicable)
  • Dark mode works correctly
  • Storybook stories cover: default, variants, states (hover, focus, disabled)
  • Tests added or updated

How to test

  1. Run the related Button tests.
  2. Verify src/components/atoms/button/Button.test.tsx now expects role="button" for aria-pressed cases.
  3. Check vite.config.ts uses ./tests/setup.ts.
  4. Check tsconfig.json targets ES2022.

Screenshots / recordings (if applicable)

No aplica.

Notes for reviewer

  • Related to atom: Button — review and complete #124, but scoped only to this targeted fix.
  • No new Button behavior is introduced.
  • This PR only aligns tests and supporting config with the current project setup.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns Button accessibility test expectations with the actual Button semantics, and brings the test/tooling configuration back into sync with the repository’s current folder layout and baseline TypeScript target (per issue #141).

Changes:

  • Update Button tests to assert role="button" (not role="switch") for aria-pressed toggle-button cases.
  • Fix Vitest setupFiles path to use ./tests/setup.ts (matching the repo’s tests/ directory).
  • Adjust tsconfig.json compiler target from ES2024 to ES2022.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
vite.config.ts Points Vitest setup to the existing tests/setup.ts file.
tsconfig.json Lowers TS target to ES2022 to match the stated tooling baseline.
src/components/atoms/button/Button.test.tsx Updates accessibility role expectations for aria-pressed cases to button.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@egdev6
egdev6 merged commit 82824cd into main Apr 23, 2026
9 checks passed
@egdev6
egdev6 deleted the fix/config branch April 23, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config/tests): align Button test semantics and tooling config

3 participants