refactor(web): remove unused pull request state label (#9984)
This commit is contained in:
1 parent
a9caf7b708
commit
ea0487cc9a
2 files changed
-17
No files matched your search
@@ -38,7 +38,6 @@ import {
|
||||
shouldRefreshPullRequestActivity,
|
||||
resolveBaseFreshness,
|
||||
buildPullRequestTimeline,
|
||||
describePullRequestState,
|
||||
editPullRequestThreadComment,
|
||||
writePullRequestDetailSnapshot,
|
||||
} from "./pullRequestDetail.logic";
|
||||
@@ -199,15 +198,6 @@ describe("pull request primary control", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("pull request state description", () => {
|
||||
it("keeps draft and conflicts orthogonal to the terminal states", () => {
|
||||
expect(describePullRequestState("open", true)).toBe("Draft");
|
||||
expect(describePullRequestState("open", false)).toBe("Ready for review");
|
||||
expect(describePullRequestState("merged", true)).toBe("Merged");
|
||||
expect(describePullRequestState("closed", false)).toBe("Closed");
|
||||
});
|
||||
});
|
||||
|
||||
describe("pull request handoff labels", () => {
|
||||
it("names the open thread when actions write to its composer", () => {
|
||||
expect(pullRequestHandoffLabels(true)).toEqual({
|
||||
|
||||
@@ -189,13 +189,6 @@ export function isStackedPullRequestBase(
|
||||
return defaultBranch !== baseBranch;
|
||||
}
|
||||
|
||||
/** Plain-language state, shown beside the author. Conflicts are a merge signal, not a state. */
|
||||
export function describePullRequestState(state: PullRequestState, isDraft: boolean): string {
|
||||
if (state === "merged") return "Merged";
|
||||
if (state === "closed") return "Closed";
|
||||
return isDraft ? "Draft" : "Ready for review";
|
||||
}
|
||||
|
||||
/** Chronological ascending, oldest to newest — reversed for the "newest" reading order. */
|
||||
export function orderPullRequestComments<T extends { readonly createdAt: string }>(
|
||||
comments: ReadonlyArray<T>,
|
||||
|
||||
Reference in new issue
Block a user