22 lines
773 B
TypeScript
22 lines
773 B
TypeScript
import { expect, test } from 'vitest';
|
|
|
|
import { resolveRuntimeNotFoundRecoveryAction } from './runtimeNotFoundRecovery';
|
|
|
|
test('runtime not found recovery returns home after direct runtime route alert', () => {
|
|
expect(resolveRuntimeNotFoundRecoveryAction('/runtime/puzzle')).toEqual({
|
|
nextStage: 'platform',
|
|
nextPath: '/',
|
|
shouldAlert: true,
|
|
});
|
|
expect(resolveRuntimeNotFoundRecoveryAction('/runtime/puzzle/')).toEqual({
|
|
nextStage: 'platform',
|
|
nextPath: '/',
|
|
shouldAlert: true,
|
|
});
|
|
});
|
|
|
|
test('runtime not found recovery only handles direct runtime routes', () => {
|
|
expect(resolveRuntimeNotFoundRecoveryAction('/gallery/puzzle/detail')).toBeNull();
|
|
expect(resolveRuntimeNotFoundRecoveryAction('/creation/puzzle/result')).toBeNull();
|
|
});
|