mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(fortune): scope s5s fortune markup (#1150)
* fix(markdown): scope fortune markup to fortune boards * fix(fortune): store fortune output as bbcode * fix(fortune): keep legacy fortune rendering * fix(tests): resolve catalog button mock merge * fix(fortune): validate hidden fortune length
This commit is contained in:
@@ -177,6 +177,24 @@ describe('interaction stores', () => {
|
||||
expect(useChallengesStore.getState().challenges).toEqual([]);
|
||||
});
|
||||
|
||||
it('redacts generated fortune content before storing challenge publications', async () => {
|
||||
const publishChallengeAnswers = vi.fn();
|
||||
const publication = {
|
||||
content: 'body[fortune color=#fd4d32]Excellent Luck[/fortune]',
|
||||
publishChallengeAnswers,
|
||||
};
|
||||
|
||||
useChallengesStore.getState().addChallenge([{ challenges: [] }, publication] as never);
|
||||
|
||||
const storedChallenge = useChallengesStore.getState().challenges[0]?.challenge as unknown[] | undefined;
|
||||
const storedPublication = storedChallenge?.[1] as typeof publication | undefined;
|
||||
expect(storedPublication?.content).toBe('body');
|
||||
expect(storedPublication?.content).not.toContain('Excellent Luck');
|
||||
|
||||
await storedPublication?.publishChallengeAnswers(['4']);
|
||||
expect(publishChallengeAnswers).toHaveBeenCalledWith(['4']);
|
||||
});
|
||||
|
||||
it('shows the disclaimer modal until accepted, then navigates directly on later opens', () => {
|
||||
const navigate = vi.fn();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user