锁定移动剪贴板不可用读取

移动剪贴板单测覆盖底层不可用值返回 host_error

移动壳配置检查反查剪贴板不可用读取边界

共享决策日志补充剪贴板失败语义
This commit is contained in:
2026-06-20 10:37:58 +08:00
parent 00f4af13c6
commit ea50282e11
3 changed files with 26 additions and 2 deletions
@@ -119,6 +119,15 @@ describe('mobile clipboard helpers', () => {
});
});
test('rejects unavailable clipboard text without reporting a successful empty value', async () => {
vi.mocked(Clipboard.getStringAsync).mockResolvedValue(undefined as never);
await expect(readMobileClipboardText()).rejects.toMatchObject({
code: 'host_error',
message: 'clipboard text unavailable',
});
});
test('wraps HostBridge clipboard read responses', async () => {
vi.mocked(Clipboard.getStringAsync).mockResolvedValue('作品号 PZ-1');