feat: wire mobile workspace into project loop
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import { getProjectWorkProgress, getProjectWorkStatus } from "./project-work";
|
||||
import {
|
||||
getProjectWorkNextAction,
|
||||
getProjectWorkProgress,
|
||||
getProjectWorkStatus,
|
||||
} from "./project-work";
|
||||
|
||||
describe("project work state mapping", () => {
|
||||
test("maps issue and run statuses to the same product language", () => {
|
||||
@@ -27,4 +31,14 @@ describe("project work state mapping", () => {
|
||||
getProjectWorkProgress("completed")
|
||||
);
|
||||
});
|
||||
|
||||
test("maps each state to the next product action", () => {
|
||||
expect(getProjectWorkNextAction("open")).toBe("Start the project manager");
|
||||
expect(getProjectWorkNextAction("failed")).toBe(
|
||||
"Review the failure and retry"
|
||||
);
|
||||
expect(getProjectWorkNextAction("completed")).toBe(
|
||||
"Review the pull request"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,6 +41,18 @@ export interface ProjectWorkStatus {
|
||||
readonly verification: ProjectVerificationStatus;
|
||||
}
|
||||
|
||||
const NEXT_ACTION_MAP: Readonly<
|
||||
Record<ProjectIssueStatus | ProjectRunStatus, string>
|
||||
> = {
|
||||
completed: "Review the pull request",
|
||||
failed: "Review the failure and retry",
|
||||
"needs-input": "Resolve the open question",
|
||||
open: "Start the project manager",
|
||||
queued: "Watch the run progress",
|
||||
ready: "Watch the run progress",
|
||||
working: "Wait for verification",
|
||||
};
|
||||
|
||||
const STATUS_MAP: Readonly<
|
||||
Record<ProjectIssueStatus | ProjectRunStatus, ProjectWorkStatus>
|
||||
> = {
|
||||
@@ -113,3 +125,7 @@ export const getProjectWorkProgress = (
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getProjectWorkNextAction = (
|
||||
status: ProjectIssueStatus | ProjectRunStatus
|
||||
): string => NEXT_ACTION_MAP[status];
|
||||
|
||||
Reference in New Issue
Block a user