Refactored the test suite to use `beforeEach` for mocking `global.fetch` and `afterEach` for cleaning up `document.body`. This ensures that `fetch` is available for all tests and that DOM state (specifically elements with duplicate IDs) does not leak between tests, resolving `TypeError: Cannot read properties of null` failures in `UploadModal.bindEvents`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Add fallback mock to `js/nostrToolsBootstrap.js` for test environments.
- Add guards to `js/ui/components/UploadModal.js` to prevent stale state updates.
- Ensure service calls are awaited in `js/ui/tagPreferenceMenuController.js`.
- Fix `tests/ui/uploadModal-reset.test.mjs` setup and environment.
Co-authored-by: PR0M3TH3AN <[email protected]>