mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Add board directory view (#1132)
* feat(directory): add board directory view * fix(directory): populate board status * style(directory): tighten board table * docs(board manager): point board owners to manager * fix(directory): show loading status * style(directory): center board column in directory table * perf(directory): cap board status checks * style(directory): simplify board row links * test(ci): stabilize coverage run * test(ci): stabilize coverage harness * test(ci): avoid async app flush act * test(app): narrow layout harness coverage * test(ci): stabilize app update distribution mock * test(ci): preload app harness before route tests * fix(directory): address final review findings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { KNOWN_5CHAN_DEVELOPER_ENTRIES, getAuthorBadge, isKnown5chanDeveloper } from '../author-display-utils';
|
||||
import { KNOWN_5CHAN_DEVELOPER_ENTRIES, get5chanDeveloperBadge, getAuthorBadge, isKnown5chanDeveloper } from '../author-display-utils';
|
||||
|
||||
describe('author display utils', () => {
|
||||
it('recognizes the hardcoded 5chan developer addresses', () => {
|
||||
@@ -38,6 +38,15 @@ describe('author display utils', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('returns only the 5chan Dev badge for known developers', () => {
|
||||
expect(get5chanDeveloperBadge('plebeius.bso')).toEqual({
|
||||
icon: 'admin',
|
||||
label: '5chan Dev',
|
||||
title: '5chan Dev',
|
||||
});
|
||||
expect(get5chanDeveloperBadge('other.bso')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('keeps board role labels for non-developers', () => {
|
||||
expect(getAuthorBadge({ address: 'other.bso', role: 'moderator' })).toEqual({
|
||||
capitalizeLabel: true,
|
||||
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
isArchiveRoute,
|
||||
isBoardModRoute,
|
||||
isDirectoryBoard,
|
||||
isDirectoryListRoute,
|
||||
isDirectoryRoute,
|
||||
isFeedRoute,
|
||||
isLegacyBoardModQueueRoute,
|
||||
isModQueueRoute,
|
||||
@@ -60,6 +62,8 @@ describe('directory mapping helpers', () => {
|
||||
expect(areSameBoardAddress('music-posting.eth', 'business.eth')).toBe(false);
|
||||
expect(areSameBoardAddress(undefined, 'business.eth')).toBe(false);
|
||||
|
||||
expect(isDirectoryRoute('biz', communities)).toBe(true);
|
||||
expect(isDirectoryRoute('business.eth', communities)).toBe(false);
|
||||
expect(isDirectoryBoard('biz', communities)).toBe(true);
|
||||
expect(isDirectoryBoard('business.eth', communities)).toBe(false);
|
||||
});
|
||||
@@ -118,6 +122,15 @@ describe('isFeedRoute', () => {
|
||||
expect(isArchiveRoute('/biz/archive/settings')).toBe(true);
|
||||
});
|
||||
|
||||
it('returns false for board directory paths', () => {
|
||||
expect(isFeedRoute('/biz/directory')).toBe(false);
|
||||
expect(isFeedRoute('/biz/directory/settings')).toBe(false);
|
||||
expect(isDirectoryListRoute('/biz/directory')).toBe(true);
|
||||
expect(isDirectoryListRoute('/biz/directory/settings')).toBe(true);
|
||||
expect(isDirectoryListRoute('/biz/archive')).toBe(false);
|
||||
expect(isDirectoryListRoute('/biz')).toBe(false);
|
||||
});
|
||||
|
||||
it('returns false for posts and pending items', () => {
|
||||
expect(isFeedRoute('/biz/thread/abc')).toBe(false);
|
||||
expect(isFeedRoute('/pending/4')).toBe(false);
|
||||
|
||||
Reference in New Issue
Block a user