00b41b6a29
移动端壳拆分为 host-bridge 与 shell 目录 桌面端 Tauri 拆分为 host_bridge 与 shell Rust 模块 更新三端桥接层结构门禁与配置检查 同步宿主壳方案文档和项目共享决策
29 lines
856 B
TypeScript
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',
|
|
});
|
|
});
|
|
});
|