Commit Graph
5 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 4bdcfbdb2e Refactor: Replace duplicated extractDTagValue in DeleteModal
Replaced the local `extractDTagValue` function in `js/ui/components/DeleteModal.js` with the shared `getDTagValueFromTags` utility from `js/nostr/nip71.js` (exported via `js/nostr/index.js`).

Added a new unit test `tests/ui/components/DeleteModal.test.mjs` to verify the d-tag extraction logic and ensure the refactor is correct and safe. This test uses `jsdom` to mock the necessary DOM environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:39:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN 54be0efcac [decompose] extract helpers from js/ui/components/VideoModal.js
Decomposed js/ui/components/VideoModal.js by extracting "Similar Video" and "Pointer Key" logic into a new helper module js/ui/components/VideoModalSimilarHelpers.js.

- Reduced VideoModal.js line count from 6334 to 6045.
- Added comprehensive unit tests for extracted helpers.
- Updated check-file-size.mjs baseline.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 11:46:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7dc5342714 fix: Ensure ResizeObserver is undefined in global scope for fallback tests
- The `setup-localstorage.mjs` test helper polyfills `ResizeObserver` on `globalThis`, which prevented `HashtagStripHelper` from falling back to `window.resize` logic during testing.
- Updated `tests/ui/components/hashtagStripHelper.test.mjs` to temporarily unset `globalThis.ResizeObserver` during tests that verify fallback behavior.
- Ensures the component correctly detects the absence of `ResizeObserver` and falls back to `requestAnimationFrame` or `setTimeout` mechanisms.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 02:00:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2469828d0f test: Add comprehensive tests for HashtagStripHelper resize logic
- Added `tests/ui/components/hashtagStripHelper.test.mjs` to test `ResizeObserver` integration, fallback mechanisms (RAF/setTimeout), and teardown.
- Implemented robust mocks for `ResizeObserver`, `requestAnimationFrame`, and `setTimeout` within `createDom` helper.
- Verified correct behavior for resize events and cleanup.
- Ensured test data matches `collectVideoTags` expected structure.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 01:14:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4d93ed25ce 🧪 Add tests for video menu renderers
Signed-off-by: Jules <[email protected]>

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 23:15:02 +00:00