锁定移动剪贴板不可用读取
移动剪贴板单测覆盖底层不可用值返回 host_error 移动壳配置检查反查剪贴板不可用读取边界 共享决策日志补充剪贴板失败语义
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user