feat: hydrate persisted PR details on task disclosure (#3055)
This commit is contained in:
@@ -5,6 +5,7 @@ import { derivePRTaskStatusSummary } from "./pr-task-status-summary";
|
||||
function makePR(overrides: Partial<TaskPR> = {}): TaskPR {
|
||||
return {
|
||||
id: "pr-id",
|
||||
workspace_id: "workspace-1",
|
||||
task_id: "task-id",
|
||||
owner: "kdlbs",
|
||||
repo: "kandev",
|
||||
@@ -48,6 +49,7 @@ describe("structured PR task status summary", () => {
|
||||
expect(summary).toEqual({
|
||||
number: 2966,
|
||||
title: "Make pull request status easier to scan",
|
||||
author: "octocat",
|
||||
rows: [
|
||||
{ kind: "review", status: "approved", tone: "success" },
|
||||
{ kind: "ci", status: "passed", tone: "success" },
|
||||
@@ -133,6 +135,12 @@ describe("structured PR task status summary", () => {
|
||||
|
||||
expect(summary.rows).toEqual([{ kind: "merge", status: "draft", tone: "muted" }]);
|
||||
});
|
||||
|
||||
it("omits an empty author identity", () => {
|
||||
const summary = derivePRTaskStatusSummary(makePR({ author_login: " " }), false);
|
||||
|
||||
expect(summary).not.toHaveProperty("author");
|
||||
});
|
||||
});
|
||||
|
||||
describe("queued PR task status summaries", () => {
|
||||
|
||||
Reference in New Issue
Block a user