Fix moderation fixture click timeout by providing dummy URLs to prevent card hiding

- Update `docs/moderation/fixtures/index.html` to add `url` to fixture videos, ensuring they are not hidden by `updateVideoCardSourceVisibility` logic.
- Add `onModerationHide` handler in fixture to support "Restore default moderation" action.
- Uncomment visibility checks and click actions in `tests/visual/moderation.spec.ts` to enable full test flow.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-05 23:10:35 +00:00
1 parent 151e2a70d8
commit 1df91c1fe9
2 files changed
+31 -23

No files matched your search

+25 -5
View File
@@ -75,7 +75,8 @@
id: "1".repeat(64),
title: "Fixture: Blurred Preview",
pubkey: "a".repeat(64),
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg"
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg",
url: "https://example.com/video.mp4"
},
moderation: {
blockAutoplay: true,
@@ -103,7 +104,8 @@
id: "2".repeat(64),
title: "Fixture: Autoplay Blocked",
pubkey: "e".repeat(64),
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg"
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg",
url: "https://example.com/video.mp4"
},
moderation: {
blockAutoplay: true,
@@ -127,7 +129,8 @@
id: "3".repeat(64),
title: "Fixture: Override Persistence",
pubkey: "f".repeat(64),
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg"
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg",
url: "https://example.com/video.mp4"
},
moderation: {
blockAutoplay: true,
@@ -152,7 +155,8 @@
id: "4".repeat(64),
title: "Fixture: Trusted Report Hide",
pubkey: "aa".repeat(32),
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg"
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg",
url: "https://example.com/video.mp4"
},
moderation: {
blockAutoplay: true,
@@ -177,7 +181,8 @@
id: "5".repeat(64),
title: "Fixture: Trusted Mute Hide",
pubkey: "bb".repeat(32),
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg"
thumbnail: "/assets/jpg/video-thumbnail-fallback.jpg",
url: "https://example.com/video.mp4"
},
moderation: {
blockAutoplay: false,
@@ -607,6 +612,21 @@
}
return true;
};
card.onModerationHide = () => {
overrides = setOverride(overrides, video.id, { showAnyway: false });
refreshModeration();
try {
document.dispatchEvent(
new CustomEvent("video:moderation-hide", {
detail: { video }
})
);
} catch {
/* ignore fixture event errors */
}
return true;
};
}
const root = card.getRoot();