导出面板的用例跟着行为改
- `xhsMinitoolExport`:删掉对生成文案的恒真断言(`toContain('…')` 那批)与只为它们存在的用例,改成行为断言与 IPC 调用断言;
- 新增「帮我填」两条:落盘一定发生在把指令交给 agent 之前(顺序用调用表钉住)、表单不合法也照样交出去(agent 正是来收拾这份表单的);
- 打包那颗按钮的用例按新行为改:没有脚本时点下去要开适配弹窗,而不是变灰;
- `xhsMinitoolContract` 只留一条:工作目录、脚本名、注册表与产物路径与 Rust 权威逐条一致。
This commit is contained in:
@@ -16,13 +16,9 @@ import { describe, expect, it } from 'vitest';
|
||||
|
||||
import {
|
||||
XHS_MINITOOL_ARTIFACT_RELATIVE_PATH,
|
||||
XHS_MINITOOL_COPIED_SCRIPTS,
|
||||
XHS_MINITOOL_EXPORT_DIR_RELATIVE_PATH,
|
||||
XHS_MINITOOL_PACK_SCRIPT_RELATIVE_PATH,
|
||||
XHS_MINITOOL_REGISTRY_RELATIVE_PATH,
|
||||
XHS_MINITOOL_SCRIPT_NAME,
|
||||
XHS_MINITOOL_VALIDATE_SCRIPT_RELATIVE_PATH,
|
||||
XHS_MINITOOL_VITE_CONFIG_RELATIVE_PATH,
|
||||
} from '../src/view/project-development/export/state/xhsMinitoolInstruction';
|
||||
import { repoPath } from './repoPath';
|
||||
|
||||
@@ -59,22 +55,4 @@ describe('小红书小工具的契约常量', () => {
|
||||
`${dir}/${rustStringConst(layout, 'ARTIFACT_FILE_NAME')}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('拷进项目的三个脚本都落在工作目录里', () => {
|
||||
const destinations: Record<string, string> = {
|
||||
'scripts/pack.mjs': XHS_MINITOOL_PACK_SCRIPT_RELATIVE_PATH,
|
||||
'scripts/validate.mjs': XHS_MINITOOL_VALIDATE_SCRIPT_RELATIVE_PATH,
|
||||
'scripts/vite.config.xhs-minitool.mjs':
|
||||
XHS_MINITOOL_VITE_CONFIG_RELATIVE_PATH,
|
||||
};
|
||||
// 拷贝清单就是把上面这三个落点排成 agent 要执行的动作,它不该自己再有一套路径。
|
||||
expect(
|
||||
XHS_MINITOOL_COPIED_SCRIPTS.map(({ from, to }) => ({ from, to })),
|
||||
).toEqual(Object.entries(destinations).map(([from, to]) => ({ from, to })));
|
||||
for (const { to } of XHS_MINITOOL_COPIED_SCRIPTS) {
|
||||
expect(to.startsWith(`${XHS_MINITOOL_EXPORT_DIR_RELATIVE_PATH}/`)).toBe(
|
||||
true,
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user