games: active vs non-active games (games.library.active, owner toggles on the dashboard and each game ⋯ menu; nothing deleted). Header flyout and mobile menu list every game split into active / non-active; /trackers and home tiles show active chips and open both sections on hover; /start shows active with a non-active toggle. Games dashboard moved from /projects/game-tracker to /trackers/games (dashboard of active games only; old URL and /credits 301); deep trackers stay put
All checks were successful
Deploy production / deploy (push) Successful in 1m13s
All checks were successful
Deploy production / deploy (push) Successful in 1m13s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { visibleTrackers } from './projects';
|
||||
import { activeGames, pokemonEntryFor, sortedGames, visibleTrackers } from './projects';
|
||||
|
||||
describe('trackers', () => {
|
||||
it('lists tasks, money, reading first for the owner', () => {
|
||||
@@ -28,4 +28,28 @@ describe('trackers', () => {
|
||||
expect(owner.find((t) => t.name === 'money')?.locked).toBe(true);
|
||||
expect(owner.find((t) => t.name === 'reading')?.locked).toBeUndefined();
|
||||
});
|
||||
it('splits games into active first and non-active (flagged) after', () => {
|
||||
const off = ['lol', 'black-ops', 'pokemon-x-y'];
|
||||
const games = visibleTrackers(true, off).find((t) => t.name === 'games')!.children!;
|
||||
const inactive = games.filter((g) => g.inactive).map((g) => g.href);
|
||||
expect(inactive).toEqual([
|
||||
'/trackers/games/lol',
|
||||
'/trackers/games/black-ops',
|
||||
'/trackers/games/pokemon-x-y'
|
||||
]);
|
||||
expect(games.slice(-3).every((g) => g.inactive)).toBe(true);
|
||||
expect(games.filter((g) => !g.inactive).every((g) => g.featured)).toBe(true);
|
||||
expect(activeGames(off)).toHaveLength(sortedGames(off).length - 3);
|
||||
expect(
|
||||
visibleTrackers(true)
|
||||
.find((t) => t.name === 'games')!
|
||||
.children!.some((g) => g.inactive)
|
||||
).toBe(false);
|
||||
});
|
||||
it('maps Pokémon journal games to their generation entry', () => {
|
||||
expect(pokemonEntryFor('platinum')).toBe('pokemon-diamond-pearl-platinum');
|
||||
expect(pokemonEntryFor('soulsilver')).toBe('pokemon-heartgold-soulsilver');
|
||||
expect(pokemonEntryFor('the-teal-mask-violet')).toBe('pokemon-scarlet-violet');
|
||||
expect(pokemonEntryFor('champions')).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user