Introduce a PR tab in the explorer sidebar that shows status checks, reviews, and the merged timeline for the current branch's pull request. Extend checkout PR status with number, draft flag, repo identity, and per-check workflow/duration; add a new pull_request_timeline request/response pair backed by a GraphQL query; enrich the workspace git snapshot to carry the fields through to the client; and extend the checkout-git-actions store so timeline queries are invalidated alongside status when mutations land.
28 lines
754 B
TypeScript
28 lines
754 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { PrPaneData } from "./pr-pane-data";
|
|
import { formatPrTabLabel } from "./pr-tab-label";
|
|
|
|
function makePrPaneData(overrides: Partial<PrPaneData> = {}): PrPaneData {
|
|
return {
|
|
number: 42,
|
|
title: "Sample PR",
|
|
state: "open",
|
|
url: "https://github.com/getpaseo/paseo/pull/42",
|
|
reviewDecision: "pending",
|
|
awaitingReviewers: [],
|
|
checks: [],
|
|
activity: [],
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
describe("formatPrTabLabel", () => {
|
|
it("returns #<number> when data is present", () => {
|
|
expect(formatPrTabLabel(makePrPaneData({ number: 42 }))).toBe("#42");
|
|
});
|
|
|
|
it("returns #— fallback when data is null", () => {
|
|
expect(formatPrTabLabel(null)).toBe("#—");
|
|
});
|
|
});
|