Files
Genarrative/apps/mobile-shell/src/shell/mobileShellLifecycle.test.ts
T
kdletters 00b41b6a29 统一宿主壳目录边界
移动端壳拆分为 host-bridge 与 shell 目录

桌面端 Tauri 拆分为 host_bridge 与 shell Rust 模块

更新三端桥接层结构门禁与配置检查

同步宿主壳方案文档和项目共享决策
2026-06-18 16:02:55 +08:00

29 lines
856 B
TypeScript

import { describe, expect, test } from 'vitest';
import { lifecyclePayloadFromAppState } from './mobileShellLifecycle';
describe('mobileShellLifecycle', () => {
test('把 React Native AppState 映射为统一 HostBridge 生命周期状态', () => {
expect(lifecyclePayloadFromAppState('active')).toEqual({
state: 'active',
focused: true,
nativeState: 'active',
});
expect(lifecyclePayloadFromAppState('background')).toEqual({
state: 'background',
focused: false,
nativeState: 'background',
});
expect(lifecyclePayloadFromAppState('inactive')).toEqual({
state: 'inactive',
focused: false,
nativeState: 'inactive',
});
expect(lifecyclePayloadFromAppState('unknown')).toEqual({
state: 'inactive',
focused: false,
nativeState: 'unknown',
});
});
});