(
input: Parameters<WorkspaceGoalService["setGoal"]>[0],
message: string
)
| 2906 | // it as a typed `invalid_transition` Result error so the oRPC handler |
| 2907 | // doesn't leak it as an unhandled 500. |
| 2908 | async function expectSetGoalError( |
| 2909 | input: Parameters<WorkspaceGoalService["setGoal"]>[0], |
| 2910 | message: string |
| 2911 | ) { |
| 2912 | const result = await service.setGoal(input); |
| 2913 | expect(result.success).toBe(false); |
| 2914 | if (!result.success) { |
| 2915 | expect(result.error.type).toBe("invalid_transition"); |
| 2916 | if (result.error.type === "invalid_transition") { |
| 2917 | expect(result.error.message).toBe(message); |
| 2918 | } |
| 2919 | } |
| 2920 | } |
| 2921 | |
| 2922 | await expectSetGoalError( |
| 2923 | { workspaceId, status: "paused" }, |
no test coverage detected