28 lines
974 B
TypeScript
28 lines
974 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
projectDisplayNameFromProjectId,
|
|
projectIconPlaceholderLabelFromDisplayName,
|
|
} from "./project-display-name";
|
|
|
|
describe("projectDisplayNameFromProjectId", () => {
|
|
it("shows owner and repo for GitHub remote ids", () => {
|
|
expect(projectDisplayNameFromProjectId("remote:github.com/getpaseo/paseo")).toBe(
|
|
"getpaseo/paseo",
|
|
);
|
|
});
|
|
|
|
it("shows the trailing directory name for local projects", () => {
|
|
expect(projectDisplayNameFromProjectId("/Users/me/dev/paseo")).toBe("paseo");
|
|
});
|
|
});
|
|
|
|
describe("projectIconPlaceholderLabelFromDisplayName", () => {
|
|
it("uses repo name instead of owner for GitHub-style display names", () => {
|
|
expect(projectIconPlaceholderLabelFromDisplayName("getpaseo/paseo")).toBe("paseo");
|
|
});
|
|
|
|
it("returns the original display name when it has no path separator", () => {
|
|
expect(projectIconPlaceholderLabelFromDisplayName("paseo")).toBe("paseo");
|
|
});
|
|
});
|