mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 21:02:28 +00:00
test: fix video modal tests and add missing polyfills
- Added `scrollTo`, `HTMLMediaElement.prototype.pause`, and `load` polyfills in `tests/video-modal-accessibility.test.mjs` (via `setupModal`) and `tests/test-setup.mjs`. - Added defensive check in `ModalManager.teardown` to prevent `TypeError` when removing event listeners. - Updated `tests/video-modal-moderation.test.mjs` to use correct selector `[data-moderation-bar]` and updated assertions for moderation overlay visibility (override state). - Created `tests/test-setup.mjs` to handle early global polyfills for dependencies like `floating-ui`. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
8e6257881d
commit
ecd59b616b
4 files changed
+57
-7
No files matched your search
@@ -705,10 +705,12 @@ export default class ModalManager {
|
||||
|
||||
if (this.uploadModal && this.uploadSubmitHandler) {
|
||||
try {
|
||||
this.uploadModal.removeEventListener(
|
||||
"upload:submit",
|
||||
this.uploadSubmitHandler,
|
||||
);
|
||||
if (typeof this.uploadModal.removeEventListener === "function") {
|
||||
this.uploadModal.removeEventListener(
|
||||
"upload:submit",
|
||||
this.uploadSubmitHandler,
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
devLogger.warn("[ModalManager] Failed to remove upload submit handler:", error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user