teamPlanDisplayName.test.ts 697 B

12345678910111213141516171819202122232425
  1. import { describe, expect, it } from "vitest";
  2. import { formatTeamPlanDisplayName } from "@/lib/teamPlanDisplayName.js";
  3. describe("formatTeamPlanDisplayName", () => {
  4. it("优先只显示组织名称", () => {
  5. expect(
  6. formatTeamPlanDisplayName({
  7. organizationId: "123245",
  8. organizationName: "Organization",
  9. projectId: "project-a",
  10. projectName: "Project",
  11. }),
  12. ).toBe("Organization");
  13. });
  14. it("没有组织名称时不兜底显示 ID 或项目信息", () => {
  15. expect(
  16. formatTeamPlanDisplayName({
  17. organizationId: "123245",
  18. projectId: "project-a",
  19. projectName: "Project",
  20. }),
  21. ).toBeNull();
  22. });
  23. });