mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-21 04:41:48 +08:00
- 修复新版数据视图底部分页、列快速定位与当前页查找的对齐和压缩问题 - 优化窄屏下 AI 面板布局,避免挤压工作区并增加懒加载失败重试兜底 - 补充窗口运行时、AI 面板布局与 UI 回归测试,更新相关样式快照
22 lines
910 B
TypeScript
22 lines
910 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { safeWindowRuntimeCall } from './wailsRuntime';
|
|
|
|
describe('safeWindowRuntimeCall', () => {
|
|
it('accepts synchronous runtime return values', async () => {
|
|
await expect(safeWindowRuntimeCall(() => true, false)).resolves.toBe(true);
|
|
await expect(safeWindowRuntimeCall(() => ({ w: 1280, h: 720 }), null)).resolves.toEqual({ w: 1280, h: 720 });
|
|
});
|
|
|
|
it('keeps supporting Promise based runtime return values', async () => {
|
|
await expect(safeWindowRuntimeCall(async () => false, true)).resolves.toBe(false);
|
|
});
|
|
|
|
it('falls back when the runtime call throws or rejects', async () => {
|
|
await expect(safeWindowRuntimeCall(() => {
|
|
throw new Error('sync failure');
|
|
}, false)).resolves.toBe(false);
|
|
await expect(safeWindowRuntimeCall(async () => Promise.reject(new Error('async failure')), true)).resolves.toBe(true);
|
|
});
|
|
});
|