forked from longtao.wu/droboticflow
21 lines
1.1 KiB
JavaScript
21 lines
1.1 KiB
JavaScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import fs from "node:fs";
|
|
const read = (p) => fs.readFileSync(new URL("../../" + p, import.meta.url), "utf8");
|
|
test("multi-selection opens a single batch confirmation rather than the single-project rejection", () => {
|
|
const page = read("src/pages/Projects.tsx");
|
|
assert.match(page, /setBatchDeletionIds\(\[\.\.\.selectedProjectIds\]\)/);
|
|
assert.doesNotMatch(page, /请每次选择一个项目/);
|
|
assert.match(page, /批量删除/);
|
|
});
|
|
test("batch deletion confirms once and preserves per-project errors, progress and retries", () => {
|
|
const dialog = read("src/components/BatchProjectDeletionDialog.tsx");
|
|
assert.match(dialog, /client\.batch/);
|
|
assert.match(dialog, /client\.list/);
|
|
assert.match(dialog, /submit\(\[row\]\)/);
|
|
assert.match(dialog, /重试此项目未完成步骤/);
|
|
assert.match(dialog, /原始输入、账号、供应商及共享资源保留/);
|
|
assert.doesNotMatch(dialog, /输入完整项目名称|删除原因<input/);
|
|
assert.match(dialog, /stopRunning: stop/);
|
|
});
|