fix(tests): mock board-buttons and style-selector to avoid Solana import crash

This commit is contained in:
plebeius
2026-03-09 16:31:06 +08:00
parent 892e6e824a
commit 3b341922c4
2 changed files with 12 additions and 0 deletions
@@ -37,6 +37,10 @@ vi.mock('../../version', () => ({
default: () => null,
}));
vi.mock('../../../style-selector/style-selector', () => ({
default: () => null,
}));
/** Minimal component that subscribes to feed view settings (like Board) to verify re-renders. */
const BoardModeIndicator = () => {
const enableInfiniteScroll = useFeedViewSettingsStore((state) => state.enableInfiniteScroll);
@@ -195,6 +195,14 @@ vi.mock('../../../components/footer', () => ({
CatalogFooterFirstRow: ({ subplebbitAddress }: { subplebbitAddress?: string }) =>
createElement('div', { 'data-testid': 'catalog-first-row' }, subplebbitAddress || 'multi'),
PageFooterDesktop: ({ firstRow }: { firstRow: React.ReactNode }) => createElement('div', { 'data-testid': 'catalog-footer-desktop' }, firstRow),
PageFooterMobile: ({ children }: { children: React.ReactNode }) => createElement('div', { 'data-testid': 'catalog-footer-mobile' }, children),
}));
vi.mock('../../../components/board-buttons/board-buttons', () => ({
ReturnButton: () => createElement('button', {}, 'Return'),
ArchiveButton: () => createElement('button', {}, 'Archive'),
TopButton: () => createElement('button', {}, 'Top'),
RefreshButton: () => createElement('button', {}, 'Refresh'),
}));
vi.mock('../../../components/loading-ellipsis', () => ({