Public Access
One glossary (docs/GLOSSARY.md) for all de and en texts. Five nav items; phones get a bottom bar with labels. Community page with following, followers, player search and stats. The bell is the one place for notes, news and open questions. Settings in tabs; auto-save is silent and rolls back on error. Questions page explains itself; removed games are a library filter. Own profile: menu link, public chip, copy link, private hint. Points page starts with a short summary; stats use status colors.
26 lines
946 B
JavaScript
26 lines
946 B
JavaScript
import {describe, expect, it} from 'vitest';
|
|
|
|
import {isNavActive, NAV_ITEMS} from './navItems.js';
|
|
|
|
const item = (to) => NAV_ITEMS.find((candidate) => candidate.to === to);
|
|
|
|
describe('isNavActive', () => {
|
|
it('theOwnPathAndItsChildrenAreActive', () => {
|
|
expect(isNavActive(item('/library'), '/library')).toBe(true);
|
|
expect(isNavActive(item('/library'), '/library/220')).toBe(true);
|
|
});
|
|
|
|
it('thePagesOfTheLibraryKeepLibraryActive', () => {
|
|
for (const path of ['/wishlist', '/backlog', '/search']) expect(isNavActive(item('/library'), path)).toBe(true);
|
|
});
|
|
|
|
it('theOldFollowingUrlKeepsCommunityActive', () => {
|
|
expect(isNavActive(item('/community'), '/following')).toBe(true);
|
|
});
|
|
|
|
it('aPathWithTheSamePrefixIsNotActive', () => {
|
|
expect(isNavActive(item('/library'), '/library-x')).toBe(false);
|
|
expect(isNavActive(item('/stats'), '/dashboard')).toBe(false);
|
|
});
|
|
});
|