- 源码 316 文件收编为 rusto-rs/ 文件夹,随本仓库管理 - 移除内部 .git(补丁已存档 docs/rusto-rs-metal-patch-20260912.patch,上游可随时 re-clone) - target/ 与 docs/.yarn 缓存不入库;本地改动:ROCR_* 环境变量调优 + Metal 链接修复 + 预处理测试脚本
21 lines
667 B
JavaScript
21 lines
667 B
JavaScript
import React from 'react';
|
|
import renderer, {act} from 'react-test-renderer';
|
|
import App from '../App';
|
|
|
|
jest.mock('react-native-rusto', () => ({
|
|
initialize: jest.fn(() => Promise.resolve()),
|
|
detectText: jest.fn((source, options) =>
|
|
Promise.resolve(options?.output === 'spatial' ? 'receipt total' : []),
|
|
),
|
|
}));
|
|
|
|
it('calls canonical RustO initialize and detectText overloads', async () => {
|
|
const tree = renderer.create(<App />);
|
|
await act(async () => {
|
|
tree.root.findByProps({title: 'Verify RustO API'}).props.onPress();
|
|
});
|
|
expect(tree.root.findByProps({testID: 'status'}).props.children).toBe(
|
|
'API verified: 0 items, 13 chars',
|
|
);
|
|
});
|