Skip to content

feat: add primary-cta data-testid to default Button component#463

Open
wagmiiii wants to merge 1 commit into
CredenceOrg:mainfrom
wagmiiii:feat/412-data-testid-primary-ctas
Open

feat: add primary-cta data-testid to default Button component#463
wagmiiii wants to merge 1 commit into
CredenceOrg:mainfrom
wagmiiii:feat/412-data-testid-primary-ctas

Conversation

@wagmiiii

Copy link
Copy Markdown

Closes #412

Summary

Added stable data-testid attributes to primary CTAs for Playwright and analytics without coupling them to text content or classes.

What changed

  • Created a central constants file at src/config/testIds.ts exporting TEST_IDS.PRIMARY_CTA.
  • Updated the Button component to automatically apply this test ID when variant="primary" (the default variant) and no overriding data-testid is supplied.
  • Updated docs/COMPONENTS.md to formally document this new accessibility/testing capability for the Button primitive.

Acceptance Criteria Checklist

  • The change matches the summary above.
  • No regression in the existing test suite.
  • The change is documented where it is observable (docs/COMPONENTS.md).
  • Lint, type-check, and tests all pass locally.
  • PR description references this issue with Closes #.

Security Note

This change is purely presentational markup used for E2E testing and analytics hooks. No user-input paths, validation logic, or server-side interactions were altered.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@wagmiiii Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add data-testid attributes to primary CTAs

1 participant