test(web): keep pull request menu items private (#10016)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-05 00:27:48 -07:00
1 parent 1449deca0a
commit 4e59b06b84
2 files changed
+2 -9

No files matched your search

@@ -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");
@@ -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 [