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
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: