chore(web): 前端格式 - 统一十个文件的 Prettier 格式 (#561)
Original-Commit: ade0049c0b80733dfea563bac2aae9260e373cf0 style(web): 前端格式 - 补 Prettier 格式(10 个文件) 这 10 个文件(3 个组件/样式与设置页、4 个 admin 主题与控件、1 个 lib、2 个测试) 用仓库自带 Prettier 检查会 warn,`bun scripts/check-changed-formatting.mjs` 在改动到它们时 会直接判红。本次只做格式化,不改任何行为:合并的 CSS 声明、去掉多余换行与括号、 统一链式调用换行。 验证:prettier --write 后 `check-changed-formatting.mjs` 通过、typecheck 通过、 1940 条前端测试全过、eslint 通过。
This commit is contained in:
@@ -49,29 +49,18 @@ describe("pendingAgentQuestion", () => {
|
||||
const question = { question: "选哪个模型?", options: [{ label: "H3文生视频" }, { label: "Seedance 2.5" }] };
|
||||
|
||||
test("有未作答的提问 → 亮面板", () => {
|
||||
const messages = [
|
||||
{ role: "user" },
|
||||
{ role: "assistant", question },
|
||||
];
|
||||
const messages = [{ role: "user" }, { role: "assistant", question }];
|
||||
expect(pendingAgentQuestion(messages)?.question).toBe("选哪个模型?");
|
||||
});
|
||||
|
||||
test("提问之后用户已回复 → 收起面板", () => {
|
||||
const messages = [
|
||||
{ role: "assistant", question },
|
||||
{ role: "user" },
|
||||
];
|
||||
const messages = [{ role: "assistant", question }, { role: "user" }];
|
||||
expect(pendingAgentQuestion(messages)).toBeUndefined();
|
||||
});
|
||||
|
||||
test("多轮提问取最新那道;旧的那道不算数", () => {
|
||||
const later = { question: "确认开始吗?", options: [{ label: "开始" }, { label: "再改改" }] };
|
||||
const messages = [
|
||||
{ role: "assistant", question },
|
||||
{ role: "user" },
|
||||
{ role: "assistant", question },
|
||||
{ role: "assistant", question: later },
|
||||
];
|
||||
const messages = [{ role: "assistant", question }, { role: "user" }, { role: "assistant", question }, { role: "assistant", question: later }];
|
||||
expect(pendingAgentQuestion(messages)?.question).toBe("确认开始吗?");
|
||||
});
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ describe("creation library button", () => {
|
||||
const source = readCreateWorkspaceSource();
|
||||
const styles = readFileSync(resolve(import.meta.dir, "../src/styles/globals.css"), "utf8");
|
||||
|
||||
expect(source).toContain("import { Reorder, LayoutGroup, motion, useReducedMotion } from \"motion/react\"");
|
||||
expect(source).toContain('import { Reorder, LayoutGroup, motion, useReducedMotion } from "motion/react"');
|
||||
expect(source).toContain("<Reorder.Group");
|
||||
expect(source).toContain('axis="x"');
|
||||
expect(source).toContain("values={visibleAttachments}");
|
||||
|
||||
Reference in New Issue
Block a user