fix(challenge): support pkc spam blocker flow

This commit is contained in:
Tommaso Casaburi
2026-04-14 13:30:31 +07:00
parent dcb3c4427c
commit 956fb426ea
11 changed files with 266 additions and 1196 deletions
@@ -76,12 +76,13 @@ describe('usePublishPost', () => {
expect(latestValue.publishPost).toBe(testState.publishCommentMock);
expect(latestValue.publishPostOptions).toMatchObject({
author: { displayName: 'Alice' },
communityAddress: 'music.eth',
content: undefined,
link: undefined,
spoiler: true,
subplebbitAddress: 'music.eth',
title: 'Hello world',
});
expect('subplebbitAddress' in latestValue.publishPostOptions).toBe(false);
expect(typeof latestValue.publishPostOptions.onChallengeVerification).toBe('function');
expect(typeof latestValue.publishPostOptions.onError).toBe('function');
});
@@ -104,14 +104,15 @@ describe('usePublishReply', () => {
expect(typeof latestValue.publishReply).toBe('function');
expect(testState.lastPublishOptions).toMatchObject({
author: { displayName: 'Bob' },
communityAddress: 'music.eth',
content: 'Replying to >>12',
link: undefined,
parentCid: 'parent-cid',
postCid: 'parent-cid',
quotedCids: ['quoted-cid'],
spoiler: true,
subplebbitAddress: 'music.eth',
});
expect('subplebbitAddress' in (testState.lastPublishOptions || {})).toBe(false);
});
it('resolves same-board external quote references before triggering publish', async () => {