Files
Genarrative/src/routing/appRoutes.test.ts
kdletters cbc27bad4a
Some checks failed
CI / verify (push) Has been cancelled
init with react+axum+spacetimedb
2026-04-26 18:06:23 +08:00

54 lines
1.4 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { matchAppRoute } from './appRoutes';
describe('matchAppRoute', () => {
it('routes the main app by default', () => {
expect(matchAppRoute('/')).toEqual({
kind: 'game',
});
});
it('routes puzzle playground path to the standalone puzzle runtime', () => {
expect(matchAppRoute('/puzzle')).toEqual({
kind: 'puzzle-playground',
});
});
it('routes big fish playground path to the standalone big fish runtime', () => {
expect(matchAppRoute('/BIG-FISH/')).toEqual({
kind: 'big-fish-playground',
});
});
it('routes former standalone editor paths back to the main game', () => {
expect(matchAppRoute('/item-editor/tools')).toEqual({
kind: 'game',
});
expect(matchAppRoute('/behavior-editor')).toEqual({
kind: 'game',
});
expect(matchAppRoute('/NPC-EDITOR/profiles/')).toEqual({
kind: 'game',
});
});
it('routes independent page paths to the main app shell', () => {
expect(matchAppRoute('/creation/rpg/agent')).toEqual({
kind: 'game',
});
expect(matchAppRoute('/runtime/puzzle')).toEqual({
kind: 'game',
});
expect(matchAppRoute('/runtime/big-fish')).toEqual({
kind: 'game',
});
});
it('does not treat unrelated prefixes as preset editor routes', () => {
expect(matchAppRoute('/npc-editorial')).toEqual({
kind: 'game',
});
});
});