init with react+axum+spacetimedb
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-26 18:06:23 +08:00
commit cbc27bad4a
20199 changed files with 883714 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
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',
});
});
});