Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(azure-devops): a state name finished for one work item type no longer closes other types #48225

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/48225/headopened View on GitHub

Showing 3 changed files with 128 additions and 27 deletions.

x
0 of 3 viewed, 3 left
57 additions and 0 deletionspackages/source-control-azure-devops/src/server/AzureDevOpsIssueTracker.test.tsModified
View file
@@ -364,6 +364,63 @@
}).pipe(Effect.provide(NodeFileSystem.layer)),
​
+ it.effect("keeps a work item open when only another type finishes in its state", () =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const queries: string[] = [];
+ const task = {
+ ...WORK_ITEM,
+ id: 12,
+ fields: { ...WORK_ITEM.fields, "System.State": "Verified", "System.WorkItemType": "Task" },
+ };
+ const api = yield* AzureDevOpsIssueTracker.make.pipe(
+ Effect.provide(
+ Layer.mock(AzureDevOpsCli.AzureDevOpsCli)({
+ execute: ({ args }) => {
+ const resource = args[args.indexOf("--resource") + 1];
+ if (resource === "workitemtypes") {
+ // An inherited process may give one state name a category per type.
+ return Effect.succeed(
+ TestSourceControlHost.processOutput(
+ encode({
+ value: [
+ { name: "Bug", states: [{ name: "Verified", category: "Completed" }] },
+ { name: "Task", states: [{ name: "Verified", category: "InProgress" }] },
+ ],
+ }),
+ ),
+ );