chore: Prevent accidental form submissions from all internal buttons
Description
Clearing out another git stash from last week. The global form wrapper unit test hasn't really been helping us lately, and it feels like a lint rule would do a better job (which it did!). I deleted the original unit test - I don't think we really update default-props-for-components.tsx so it feels like technical debt more than anything. Added an existing rule for <button type="button">, and just made formAction a required property on InternalButton.
And as for the fixes, I'm going to assume we don't want any of these buttons to submit any forms (except for prompt input, which has a test for it - yay!). But feel free to correct me.
Related links, issue #, if available: n/a
How has this been tested?
Ran eslint with the new rules, fixed every error lint.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
- Changes include appropriate documentation updates.
- Changes are backward-compatible if not indicated, see
CONTRIBUTING.md. - Changes do not include unsupported browser features, see
CONTRIBUTING.md. - Changes were manually tested for accessibility, see accessibility guidelines.
Security
- If the code handles URLs: all URLs are validated through the
checkSafeUrlfunction.
Testing
- Changes are covered with new/existing unit tests?
- Changes are covered with new/existing integration tests?
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 95.99%. Comparing base (337ca48) to head (8a5500b).
:warning: Report is 867 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2738 +/- ##
==========================================
- Coverage 96.00% 95.99% -0.01%
==========================================
Files 749 749
Lines 20897 20899 +2
Branches 7119 7120 +1
==========================================
Hits 20063 20063
- Misses 780 781 +1
- Partials 54 55 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Closing for housecleaning. There are too many conflicts now, easier to start over