1
This commit is contained in:
@@ -15,7 +15,9 @@ import {
|
||||
describe('appPageRoutes', () => {
|
||||
it('normalizes page paths for stable matching', () => {
|
||||
expect(normalizeAppPath('')).toBe('/');
|
||||
expect(normalizeAppPath('/CREATION/RPG/AGENT/')).toBe('/creation/rpg/agent');
|
||||
expect(normalizeAppPath('/CREATION/RPG/AGENT/')).toBe(
|
||||
'/creation/rpg/agent',
|
||||
);
|
||||
});
|
||||
|
||||
it('resolves platform entry stages from independent paths', () => {
|
||||
@@ -52,11 +54,11 @@ describe('appPageRoutes', () => {
|
||||
|
||||
it('builds and reads public work detail query routes', () => {
|
||||
expect(buildPublicWorkDetailPath('CW-00000001')).toBe(
|
||||
'/worlds/detail?work=CW-00000001',
|
||||
);
|
||||
expect(buildPublicWorkDetailUrl('CW-00000001', 'https://example.test')).toBe(
|
||||
'https://example.test/worlds/detail?work=CW-00000001',
|
||||
'/works/detail?work=CW-00000001',
|
||||
);
|
||||
expect(
|
||||
buildPublicWorkDetailUrl('CW-00000001', 'https://example.test'),
|
||||
).toBe('https://example.test/works/detail?work=CW-00000001');
|
||||
expect(readPublicWorkCodeFromLocationSearch('?work=CW-00000001')).toBe(
|
||||
'CW-00000001',
|
||||
);
|
||||
|
||||
@@ -6,6 +6,7 @@ export const PUBLIC_WORK_QUERY_PARAM = 'work';
|
||||
|
||||
const STAGE_ROUTE_ENTRIES = [
|
||||
['platform', '/'],
|
||||
['work-detail', '/works/detail'],
|
||||
['detail', '/worlds/detail'],
|
||||
['agent-workspace', '/creation/rpg/agent'],
|
||||
['custom-world-generating', '/creation/rpg/generating'],
|
||||
@@ -57,7 +58,7 @@ export function readPublicWorkCodeFromLocationSearch(search: string) {
|
||||
}
|
||||
|
||||
export function buildPublicWorkDetailPath(publicWorkCode: string) {
|
||||
return buildPublicWorkStagePath('detail', publicWorkCode);
|
||||
return buildPublicWorkStagePath('work-detail', publicWorkCode);
|
||||
}
|
||||
|
||||
export function buildPublicWorkStagePath(
|
||||
|
||||
Reference in New Issue
Block a user