Files
Genarrative/apps/ai-game-creator-shell/tests/uiDesignStateStore.test.ts
T
k88936 48254855e9 接入项目 UI 设计资源
新增 UI 设计资源的 manifest 登记与资源画布入口

将 UI 编辑器接入项目工作台并提供保存返回交互

补充 UI State mock 存储、资源投影与定向测试
2026-08-18 21:10:27 +08:00

21 lines
658 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest';
import { mockUiDesignStateStore } from '../src/features/ui-editor/uiDesignStateStore';
describe('UI 设计 State mock store', () => {
it('每次 load 返回一个新的空 Statesave 仍按成功完成', async () => {
const first = await mockUiDesignStateStore.load('ui-1');
first.ui_trees.push({} as never);
await expect(
mockUiDesignStateStore.save('ui-1', first),
).resolves.toBeUndefined();
await expect(mockUiDesignStateStore.load('ui-1')).resolves.toEqual({
ui_trees: [],
ui_design_images: {},
sprite_assets: {},
font_assets: {},
});
});
});