20 lines
740 B
JavaScript
20 lines
740 B
JavaScript
import assert from "node:assert/strict";
|
|
import fs from "node:fs";
|
|
import test from "node:test";
|
|
|
|
const filesJs = fs.readFileSync("web/static/js/files.js", "utf8");
|
|
|
|
test("file menu exposes an explicit confirmed replacement action", () => {
|
|
assert.match(filesJs, /label: "替换文件"/);
|
|
assert.match(filesJs, /title: "替换文件"/);
|
|
assert.match(filesJs, /okText: "确认替换"/);
|
|
assert.match(filesJs, /danger: true/);
|
|
assert.match(filesJs, /conflict: "overwrite"/);
|
|
assert.match(filesJs, /targetName: name/);
|
|
});
|
|
|
|
test("ordinary uploads default to rename conflict policy", () => {
|
|
assert.match(filesJs, /fd\.append\("conflict", opts\.conflict \|\| "rename"\)/);
|
|
assert.match(filesJs, /同名文件已保留为/);
|
|
});
|