diff --git a/tests/helpers/moderation-test-helpers.mjs b/tests/helpers/moderation-test-helpers.mjs index 1b8b4431..4563db74 100644 --- a/tests/helpers/moderation-test-helpers.mjs +++ b/tests/helpers/moderation-test-helpers.mjs @@ -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 };