What needs testing
js/utils/mb-dialog.js currently has no associated test suite in the repository.
Current coverage
Current test coverage for this file is 0% (there is no test file).
Proposed approach
I propose creating js/utils/tests/mb-dialog.test.js using the Jest framework and jsdom to write a comprehensive test suite. The approach will cover:
- Toggling default vs custom dialog parameters for
window.MBDialog.alert.
- Testing the Promise-based interface and resolution flow of
window.MBDialog.prompt.
- Verifying DOM rendering, styling, and post-close cleanup for the overlay and frame.
- Validating keyboard accessibility bindings (Escape to cancel, Enter to submit).
- Verifying the theme initialization fallback chain (
localStorage checking vs matchMedia preferred-color-scheme).
- Verifying mouse dragging behavior on the dialog title bars.
Checklist
What needs testing
js/utils/mb-dialog.js currently has no associated test suite in the repository.
Current coverage
Current test coverage for this file is 0% (there is no test file).
Proposed approach
I propose creating js/utils/tests/mb-dialog.test.js using the Jest framework and
jsdomto write a comprehensive test suite. The approach will cover:window.MBDialog.alert.window.MBDialog.prompt.localStoragechecking vsmatchMediapreferred-color-scheme).Checklist