Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(azure-devops): Issues search finds a work item by its ID #48221

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

Showing 2 changed files with 53 additions and 1 deletion.

x
0 of 2 viewed, 2 left
43 additions and 0 deletionspackages/source-control-azure-devops/src/server/AzureDevOpsIssueTracker.test.tsModified
View file
@@ -364,6 +364,49 @@
}).pipe(Effect.provide(NodeFileSystem.layer)),
​
+ it.effect("finds a work item by its numeric ID, not only by its title", () =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const bodies: string[] = [];
+ const api = yield* AzureDevOpsIssueTracker.make.pipe(
+ Effect.provide(
+ Layer.mock(AzureDevOpsCli.AzureDevOpsCli)({
+ execute: ({ args }) => {
+ const resource = args[args.indexOf("--resource") + 1];
+ if (resource === "workitemtypes") {
+ return Effect.succeed(TestSourceControlHost.processOutput(encode(WORK_ITEM_TYPES)));
+ }
+ return fs.readFileString(args[args.indexOf("--in-file") + 1]!).pipe(
+ Effect.orDie,
+ Effect.map((body) => {
+ bodies.push(body);
+ return TestSourceControlHost.processOutput(encode({ workItems: [] }));
+ }),
+ );
+ },
+ }),
+ ),
+ );
+ for (const query of ["46", "#46"]) {
+ yield* api.listIssues({
+ cwd: "/w",