48254855e9
新增 UI 设计资源的 manifest 登记与资源画布入口 将 UI 编辑器接入项目工作台并提供保存返回交互 补充 UI State mock 存储、资源投影与定向测试
21 lines
658 B
TypeScript
21 lines
658 B
TypeScript
import { describe, expect, it } from 'vitest';
|
||
|
||
import { mockUiDesignStateStore } from '../src/features/ui-editor/uiDesignStateStore';
|
||
|
||
describe('UI 设计 State mock store', () => {
|
||
it('每次 load 返回一个新的空 State,save 仍按成功完成', 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: {},
|
||
});
|
||
});
|
||
});
|