workspaceSidebarNewTaskTooltip.test.ts 697 B

12345678910111213141516171819
  1. import { readFile } from "node:fs/promises";
  2. import { describe, expect, it } from "vitest";
  3. describe("workspace sidebar new task tooltip", () => {
  4. it("正常状态不显示重复提示,仅只读状态展示禁用原因", async () => {
  5. const source = await readFile(
  6. new URL("../src/WorkspaceSidebar.tsx", import.meta.url),
  7. "utf8",
  8. );
  9. expect(source).toContain("if (!disabledReason) return children;");
  10. expect(source).toContain(
  11. "<WorkspaceNewTaskTooltip disabledReason={workspaceReadOnlyReason}>",
  12. );
  13. expect(source).not.toContain(
  14. 'workspaceReadOnlyReason ??\n intl.formatMessage({ id: "taskList.newThread" })',
  15. );
  16. });
  17. });