Merge pull request #1815 from PR0M3TH3AN/fix-moderation-test-mock-9853303796175767521

Fix userBlocks mock wiring in moderation test harness
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-27 09:59:07 -05:00
commit 36ba0db0b5
1 file changed
+10
+10
View File
@@ -272,6 +272,16 @@ export async function createModerationAppHarness(options = {}) {
app.getActiveModerationThresholds =
Application.prototype.getActiveModerationThresholds;
if (options.userBlocks) {
app.isAuthorBlocked = function (pubkey) {
const normalized = this.normalizeHexPubkey(pubkey);
if (normalized && options.userBlocks.isBlocked(normalized)) {
return true;
}
return Application.prototype.isAuthorBlocked.call(this, pubkey);
};
}
app.defaultModerationSettings = getDefaultModerationSettings();
app.moderationSettings = { ...app.defaultModerationSettings };