Files
purewhiter--mobilegym/tests/redbookBackNavigation.test.ts
wehub-resource-sync 2114b14ee0
Sync main into demo / sync (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:35:26 +08:00

27 lines
748 B
TypeScript

import { describe, expect, test } from 'vitest';
import { getRedBookBackIntent } from '../apps/RedBook/components/RedBookNavigationHandler';
describe('RedBook back navigation', () => {
test('closes root overlays before running double-back exit logic', () => {
expect(
getRedBookBackIntent({
pathname: '/',
search: '?tab=discover&menu=drawer',
currentIndex: 1,
lastBackTime: 0,
now: 10_000,
}),
).toEqual({ type: 'history-back' });
expect(
getRedBookBackIntent({
pathname: '/me',
search: '?tab=notes&sub=public&modal=publish',
currentIndex: 3,
lastBackTime: 0,
now: 10_000,
}),
).toEqual({ type: 'history-back' });
});
});