TypeScript
test(web): keep pull request menu items private (#10016)
Julius Marminge4e59b06b84fd
diff --git a/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.test.ts b/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.test.tsindex db105f97fe9..eb6f47b4c80 100644--- a/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.test.ts+++ b/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.test.ts@@ -1,15 +1,8 @@import { describe, expect, it } from "vite-plus/test";-import { openOnHostLabel, pullRequestLinkContextMenuItems } from "./pullRequestLinkContextMenu";+import { openOnHostLabel } from "./pullRequestLinkContextMenu";describe("pull request link context menu", () => {- it("offers the copy first and the host's own page after it", () => {- expect(pullRequestLinkContextMenuItems("Open on GitHub")).toEqual([- { id: "copy-link", label: "Copy link", icon: "copy" },- { id: "open-external", label: "Open on GitHub" },- ]);- });-it("names every host it knows, and says nothing false about one it does not", () => {expect(openOnHostLabel("github")).toBe("Open on GitHub");expect(openOnHostLabel("gitlab")).toBe("Open on GitLab");diff --git a/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.ts b/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.tsindex 16b749445d4..ef554d0eb3e 100644--- a/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.ts+++ b/apps/web/src/components/pullRequest/pullRequestLinkContextMenu.ts@@ -19,7 +19,7 @@ export const openOnHostLabel = (provider: string): string =>OPEN_ON_HOST_LABELS[provider] ?? "Open on host";/** Copy first: it is the reason to right-click a number rather than click it. */-export function pullRequestLinkContextMenuItems(+function pullRequestLinkContextMenuItems(openLabel: string,): readonly ContextMenuItem<PullRequestLinkContextMenuAction>[] {return [