mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-03 20:38:16 +08:00
🐛 fix(ui): 修复新版数据视图布局与 AI 面板加载容错
- 修复新版数据视图底部分页、列快速定位与当前页查找的对齐和压缩问题 - 优化窄屏下 AI 面板布局,避免挤压工作区并增加懒加载失败重试兜底 - 补充窗口运行时、AI 面板布局与 UI 回归测试,更新相关样式快照
This commit is contained in:
21
frontend/src/utils/wailsRuntime.test.ts
Normal file
21
frontend/src/utils/wailsRuntime.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user