Files
ToBePlayed-Frontend/src/components/navItems.test.js
T
lobo 3712e3905f
Build, Test & Push Frontend / quality-check (push) Successful in 40s
Build, Test & Push Frontend / docker (push) Successful in 29s
feat(nav): simplify navigation and terms (#57)
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.
2026-10-21 14:54:48 +02:00

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);
});
});