test: add missing type attribute and behavior tests for Button component#1875
test: add missing type attribute and behavior tests for Button component#1875Peersheik wants to merge 2 commits intoRocketChat:mainfrom
Conversation
Adds missing unit tests for the Button component to verify: 1. Button defaults to type="button" to prevent accidental form submissions 2. Button allows overriding type attribute when explicitly passed 3. Button renders as anchor tag when is="a" prop is passed The existing tests only checked rendering and accessibility (a11y). There were no tests verifying the Button's type attribute behavior, which is critical to prevent accidental form submissions in apps using Fuselage components. Issue(s): Closes RocketChat#1813 Further comments: This PR adds test coverage for the default type="button" behavior discussed in RocketChat#1813. The Button component already correctly sets type="button" as default, but there were no tests to verify this behavior and prevent future regressions. Tests added: - Verifies Button renders with type="button" by default - Verifies type attribute can be overridden when explicitly passed - Verifies Button renders as anchor when is="a" prop is passed
|
|
|
|
Hi there, thanks for the contribution 🚀 We're not interested on this because it won't add much value in our codebase, because of that I'm closing this one Questions? Help needed? Feature Requests?
|
Adds missing unit tests for the Button component to verify:
The existing tests only checked rendering and accessibility (a11y).
There were no tests verifying the Button's type attribute behavior,
which is critical to prevent accidental form submissions in apps
using Fuselage components.
Issue(s):
Closes #1813
Further comments:
This PR adds test coverage for the default type="button" behavior
discussed in #1813. The Button component already correctly sets
type="button" as default, but there were no tests to verify this
behavior and prevent future regressions.
Tests added: