feat: add child motion entry and fix auth env
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-05-10 18:27:51 +08:00
parent 86fc382413
commit 46a254f142
22 changed files with 2868 additions and 58 deletions

View File

@@ -1,7 +1,11 @@
import { describe, expect, it } from 'vitest';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { matchAppRoute } from './appRoutes';
afterEach(() => {
vi.unstubAllEnvs();
});
describe('matchAppRoute', () => {
it('routes the main app by default', () => {
expect(matchAppRoute('/')).toEqual({
@@ -27,6 +31,20 @@ describe('matchAppRoute', () => {
});
});
it('routes child motion demo path to the standalone warmup demo', () => {
expect(matchAppRoute('/CHILD-MOTION-DEMO/')).toEqual({
kind: 'child-motion-demo',
});
});
it('blocks direct child motion demo path when edutainment entry is disabled', () => {
vi.stubEnv('VITE_ENABLE_EDUTAINMENT_ENTRY', 'false');
expect(matchAppRoute('/child-motion-demo')).toEqual({
kind: 'game',
});
});
it('routes former standalone editor paths back to the main game', () => {
expect(matchAppRoute('/item-editor/tools')).toEqual({
kind: 'game',