mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(archive): implement comment.archived and add archive page (#1074)
* feat(archive): implement comment.archived and add archive page Add isCommentArchived() utility, /board/:boardIdentifier/archive route, archive view with filtered feed, and UI integration (board buttons, edit menu, catalog row, post). Archived indicator on catalog and posts. * fix(archive): address review feedback from Bugbot and CodeRabbit Add missing i18n keys (archived, thread_archived, view, loading_archive), add /archive/settings route, replace hardcoded English in archive.tsx, and fix mobile test state.
This commit is contained in:
@@ -12,6 +12,9 @@ type TestComment = {
|
||||
cid?: string;
|
||||
content?: string;
|
||||
error?: Error;
|
||||
commentModeration?: {
|
||||
archived?: boolean;
|
||||
};
|
||||
locked?: boolean;
|
||||
number?: number;
|
||||
parentCid?: string;
|
||||
@@ -302,6 +305,27 @@ describe('Post', () => {
|
||||
expect(HTMLElement.prototype.scrollIntoView).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('passes archived OP state through to thread footers as closed', async () => {
|
||||
testState.commentsByCid = {
|
||||
'archived-thread': {
|
||||
cid: 'archived-thread',
|
||||
content: 'thread',
|
||||
commentModeration: {
|
||||
archived: true,
|
||||
},
|
||||
number: 777,
|
||||
replyCount: 0,
|
||||
subplebbitAddress: 'music-posting.eth',
|
||||
title: 'Archived thread',
|
||||
},
|
||||
};
|
||||
|
||||
await renderPostPage('/mu/thread/archived-thread');
|
||||
|
||||
expect(container.querySelector('[data-testid="thread-footer-first-row"]')?.textContent).toBe('archived-thread:777:music-posting.eth:true');
|
||||
expect(container.querySelector('[data-testid="thread-footer-mobile"]')?.textContent).toBe('archived-thread:777:music-posting.eth:true');
|
||||
});
|
||||
|
||||
it('only aligns the OP container when navigation explicitly requests it', async () => {
|
||||
testState.commentsByCid = {
|
||||
'thread-cid': {
|
||||
|
||||
Reference in New Issue
Block a user