mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Add hidden trash board (#1183)
* feat(trash-board): add hidden trash board * fix(trash-board): resolve special board transfer lookups * fix(trash-board): exclude source aliases from transfers * fix(trash-board): avoid hidden rules hash
This commit is contained in:
@@ -5,6 +5,7 @@ import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import communitiesPagesStore from '@bitsocial/bitsocial-react-hooks/dist/stores/communities-pages';
|
||||
import Board, { type BoardProps } from '../board';
|
||||
import { TRASH_BOARD_ADDRESS, TRASH_BOARD_TITLE } from '../../../lib/special-boards';
|
||||
import { clearStableLastVisitTimeFilterName, LAST_VISIT_STORAGE_KEY } from '../../../lib/utils/time-filter-utils';
|
||||
|
||||
(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
||||
@@ -564,6 +565,21 @@ describe('Board', () => {
|
||||
expect(container.textContent).not.toContain('board_address_unverified_warning');
|
||||
});
|
||||
|
||||
it('uses hidden special board metadata for the page title', async () => {
|
||||
testState.directories = [];
|
||||
testState.directoryByAddress = {};
|
||||
testState.resolvedCommunityAddress = TRASH_BOARD_ADDRESS;
|
||||
testState.communitySnapshot = {};
|
||||
|
||||
await renderBoard({
|
||||
boardProps: { boardIdentifier: 'trash', viewType: 'board' },
|
||||
initialEntry: '/trash',
|
||||
routePath: '/:boardIdentifier/*',
|
||||
});
|
||||
|
||||
expect(document.title).toBe(`${TRASH_BOARD_TITLE} - 5chan`);
|
||||
});
|
||||
|
||||
it('renders the current page feed, inserts recent account comments, and wires footer actions', async () => {
|
||||
const currentTimestamp = Math.floor(Date.now() / 1000);
|
||||
testState.feed = [
|
||||
|
||||
Reference in New Issue
Block a user