Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ProjectSettingsPanel.logic.test.ts

23 lines839 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { projectGroupTitleNeedsUpdate } from "./ProjectSettingsPanel.logic";
4​
5describe("projectGroupTitleNeedsUpdate", () => {
6 it("updates divergent member titles even when the next title is the derived group label", () => {
7 expect(
8 projectGroupTitleNeedsUpdate(["local-title", "remote-title"], "Repository name", true),
9 ).toBe(true);
10 });
11​
12 it("skips an untouched blur when the derived label differs from member titles", () => {
13 expect(projectGroupTitleNeedsUpdate(["repo-slug", "repo-slug"], "Repository Name", false)).toBe(
14 false,
15 );
16 });
17​
18 it("skips an update when every member already has the next title", () => {
19 expect(projectGroupTitleNeedsUpdate(["Shared name", "Shared name"], "Shared name", true)).toBe(
20 false,
21 );
22 });
23});