github-issue-tower-defence-management 1.69.1 → 1.69.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +4 -4
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/bin/adapter/repositories/issue/GraphqlProjectItemRepository.js +1 -1
- package/bin/adapter/repositories/issue/GraphqlProjectItemRepository.js.map +1 -1
- package/bin/domain/usecases/StartPreparationUseCase.js +1 -2
- package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +7 -4
- package/src/adapter/repositories/issue/GraphqlProjectItemRepository.test.ts +5 -5
- package/src/adapter/repositories/issue/GraphqlProjectItemRepository.ts +1 -1
- package/src/domain/usecases/StartPreparationUseCase.test.ts +152 -249
- package/src/domain/usecases/StartPreparationUseCase.ts +2 -6
- package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +4 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/adapter/repositories/issue/GraphqlProjectItemRepository.d.ts +1 -1
- package/types/adapter/repositories/issue/GraphqlProjectItemRepository.d.ts.map +1 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts +1 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
|
@@ -9,24 +9,8 @@ import { ClaudeTokenUsageRepository } from './adapter-interfaces/ClaudeTokenUsag
|
|
|
9
9
|
import { ClaudeTokenUsage } from '../entities/ClaudeTokenUsage';
|
|
10
10
|
import { Issue } from '../entities/Issue';
|
|
11
11
|
import { Project } from '../entities/Project';
|
|
12
|
-
import { StoryObjectMap } from '../entities/StoryObjectMap';
|
|
13
12
|
type Mocked<T> = jest.Mocked<T> & jest.MockedObject<T>;
|
|
14
13
|
|
|
15
|
-
const createMockStoryObjectMap = (issues: Issue[]): StoryObjectMap => {
|
|
16
|
-
const map: StoryObjectMap = new Map();
|
|
17
|
-
map.set('Default Story', {
|
|
18
|
-
story: {
|
|
19
|
-
id: 'story-1',
|
|
20
|
-
name: 'Default Story',
|
|
21
|
-
color: 'GRAY',
|
|
22
|
-
description: '',
|
|
23
|
-
},
|
|
24
|
-
storyIssue: null,
|
|
25
|
-
issues: issues,
|
|
26
|
-
});
|
|
27
|
-
return map;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
14
|
const createMockIssue = (overrides: Partial<Issue> = {}): Issue => ({
|
|
31
15
|
nameWithOwner: 'user/repo',
|
|
32
16
|
number: 1,
|
|
@@ -82,7 +66,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
82
66
|
let mockIssueRepository: Mocked<
|
|
83
67
|
Pick<
|
|
84
68
|
IssueRepository,
|
|
85
|
-
| '
|
|
69
|
+
| 'getAllOpened'
|
|
86
70
|
| 'updateStatus'
|
|
87
71
|
| 'findRelatedOpenPRs'
|
|
88
72
|
| 'getOpenPullRequest'
|
|
@@ -101,7 +85,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
101
85
|
getByUrl: jest.fn(),
|
|
102
86
|
};
|
|
103
87
|
mockIssueRepository = {
|
|
104
|
-
|
|
88
|
+
getAllOpened: jest.fn().mockResolvedValue([]),
|
|
105
89
|
updateStatus: jest.fn(),
|
|
106
90
|
findRelatedOpenPRs: jest.fn().mockResolvedValue([]),
|
|
107
91
|
getOpenPullRequest: jest.fn().mockResolvedValue(null),
|
|
@@ -134,9 +118,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
134
118
|
}),
|
|
135
119
|
];
|
|
136
120
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
137
|
-
mockIssueRepository.
|
|
138
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
139
|
-
);
|
|
121
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
140
122
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
141
123
|
stdout: '',
|
|
142
124
|
stderr: '',
|
|
@@ -176,6 +158,56 @@ describe('StartPreparationUseCase', () => {
|
|
|
176
158
|
],
|
|
177
159
|
]);
|
|
178
160
|
});
|
|
161
|
+
it('should move awaiting workspace issue with story=null to preparation', async () => {
|
|
162
|
+
const issueWithoutStory = createMockIssue({
|
|
163
|
+
url: 'https://github.com/user/repo/issues/55',
|
|
164
|
+
number: 55,
|
|
165
|
+
title: 'Issue without story',
|
|
166
|
+
labels: ['category:impl'],
|
|
167
|
+
status: 'Awaiting Workspace',
|
|
168
|
+
story: null,
|
|
169
|
+
});
|
|
170
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
171
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([issueWithoutStory]);
|
|
172
|
+
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
173
|
+
stdout: '',
|
|
174
|
+
stderr: '',
|
|
175
|
+
exitCode: 0,
|
|
176
|
+
});
|
|
177
|
+
await useCase.run({
|
|
178
|
+
projectUrl: 'https://github.com/user/repo',
|
|
179
|
+
defaultAgentName: 'agent1',
|
|
180
|
+
defaultLlmModelName: 'claude-opus',
|
|
181
|
+
defaultLlmAgentName: null,
|
|
182
|
+
configFilePath: '/path/to/config.yml',
|
|
183
|
+
maximumPreparingIssuesCount: null,
|
|
184
|
+
utilizationPercentageThreshold: 90,
|
|
185
|
+
allowedIssueAuthors: null,
|
|
186
|
+
codexHomeCandidates: null,
|
|
187
|
+
allowIssueCacheMinutes: 0,
|
|
188
|
+
labelsAsLlmAgentName: null,
|
|
189
|
+
});
|
|
190
|
+
expect(mockIssueRepository.updateStatus.mock.calls).toHaveLength(1);
|
|
191
|
+
expect(mockIssueRepository.updateStatus.mock.calls[0][1]).toMatchObject({
|
|
192
|
+
url: 'https://github.com/user/repo/issues/55',
|
|
193
|
+
story: null,
|
|
194
|
+
status: 'Preparation',
|
|
195
|
+
});
|
|
196
|
+
expect(mockIssueRepository.updateStatus.mock.calls[0][2]).toBe('2');
|
|
197
|
+
expect(mockLocalCommandRunner.runCommand.mock.calls).toHaveLength(1);
|
|
198
|
+
expect(mockLocalCommandRunner.runCommand.mock.calls[0]).toEqual([
|
|
199
|
+
'aw',
|
|
200
|
+
[
|
|
201
|
+
'https://github.com/user/repo/issues/55',
|
|
202
|
+
'impl',
|
|
203
|
+
'claude-opus',
|
|
204
|
+
'--configFilePath',
|
|
205
|
+
'/path/to/config.yml',
|
|
206
|
+
'--branch',
|
|
207
|
+
'i55',
|
|
208
|
+
],
|
|
209
|
+
]);
|
|
210
|
+
});
|
|
179
211
|
it('should pass --branch to aw command when issue has an existing linked PR', async () => {
|
|
180
212
|
const awaitingIssues: Issue[] = [
|
|
181
213
|
createMockIssue({
|
|
@@ -198,9 +230,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
198
230
|
missingRequiredCheckNames: [],
|
|
199
231
|
};
|
|
200
232
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
201
|
-
mockIssueRepository.
|
|
202
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
203
|
-
);
|
|
233
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
204
234
|
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([existingPR]);
|
|
205
235
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
206
236
|
stdout: '',
|
|
@@ -244,9 +274,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
244
274
|
}),
|
|
245
275
|
];
|
|
246
276
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
247
|
-
mockIssueRepository.
|
|
248
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
249
|
-
);
|
|
277
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
250
278
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue({
|
|
251
279
|
url: 'https://github.com/user/repo/pull/354',
|
|
252
280
|
branchName: 'dependabot/npm_and_yarn/multi-cc382f683c',
|
|
@@ -305,9 +333,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
305
333
|
}),
|
|
306
334
|
];
|
|
307
335
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
308
|
-
mockIssueRepository.
|
|
309
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
310
|
-
);
|
|
336
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
311
337
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue(null);
|
|
312
338
|
const consoleWarnSpy = jest
|
|
313
339
|
.spyOn(console, 'warn')
|
|
@@ -343,9 +369,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
343
369
|
}),
|
|
344
370
|
];
|
|
345
371
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
346
|
-
mockIssueRepository.
|
|
347
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
348
|
-
);
|
|
372
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
349
373
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue({
|
|
350
374
|
url: 'https://github.com/user/repo/pull/999',
|
|
351
375
|
branchName: null,
|
|
@@ -391,9 +415,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
391
415
|
}),
|
|
392
416
|
];
|
|
393
417
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
394
|
-
mockIssueRepository.
|
|
395
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
396
|
-
);
|
|
418
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
397
419
|
mockIssueRepository.getOpenPullRequest.mockResolvedValue({
|
|
398
420
|
url: 'https://github.com/user/repo/pull/999',
|
|
399
421
|
branchName: 'evil$(rm -rf /)',
|
|
@@ -463,9 +485,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
463
485
|
missingRequiredCheckNames: [],
|
|
464
486
|
};
|
|
465
487
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
466
|
-
mockIssueRepository.
|
|
467
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
468
|
-
);
|
|
488
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
469
489
|
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
470
490
|
olderPR,
|
|
471
491
|
newerPR,
|
|
@@ -554,9 +574,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
554
574
|
missingRequiredCheckNames: [],
|
|
555
575
|
};
|
|
556
576
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
557
|
-
mockIssueRepository.
|
|
558
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
559
|
-
);
|
|
577
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
560
578
|
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
561
579
|
olderPRNullBranch,
|
|
562
580
|
newerPR,
|
|
@@ -618,9 +636,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
618
636
|
missingRequiredCheckNames: [],
|
|
619
637
|
};
|
|
620
638
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
621
|
-
mockIssueRepository.
|
|
622
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
623
|
-
);
|
|
639
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
624
640
|
mockIssueRepository.findRelatedOpenPRs.mockResolvedValue([
|
|
625
641
|
prWithNullBranch,
|
|
626
642
|
]);
|
|
@@ -663,9 +679,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
663
679
|
}),
|
|
664
680
|
];
|
|
665
681
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
666
|
-
mockIssueRepository.
|
|
667
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
668
|
-
);
|
|
682
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
669
683
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
670
684
|
stdout: '',
|
|
671
685
|
stderr: '',
|
|
@@ -720,9 +734,10 @@ describe('StartPreparationUseCase', () => {
|
|
|
720
734
|
}),
|
|
721
735
|
];
|
|
722
736
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
723
|
-
mockIssueRepository.
|
|
724
|
-
|
|
725
|
-
|
|
737
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
738
|
+
...preparationIssues,
|
|
739
|
+
...awaitingIssues,
|
|
740
|
+
]);
|
|
726
741
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
727
742
|
stdout: '',
|
|
728
743
|
stderr: '',
|
|
@@ -755,9 +770,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
755
770
|
}),
|
|
756
771
|
];
|
|
757
772
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
758
|
-
mockIssueRepository.
|
|
759
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
760
|
-
);
|
|
773
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
761
774
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
762
775
|
stdout: '',
|
|
763
776
|
stderr: '',
|
|
@@ -800,9 +813,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
800
813
|
}),
|
|
801
814
|
];
|
|
802
815
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
803
|
-
mockIssueRepository.
|
|
804
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
805
|
-
);
|
|
816
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
806
817
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
807
818
|
stdout: '',
|
|
808
819
|
stderr: '',
|
|
@@ -845,9 +856,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
845
856
|
}),
|
|
846
857
|
];
|
|
847
858
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
848
|
-
mockIssueRepository.
|
|
849
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
850
|
-
);
|
|
859
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
851
860
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
852
861
|
stdout: '',
|
|
853
862
|
stderr: '',
|
|
@@ -890,9 +899,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
890
899
|
}),
|
|
891
900
|
];
|
|
892
901
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
893
|
-
mockIssueRepository.
|
|
894
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
895
|
-
);
|
|
902
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
896
903
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
897
904
|
stdout: '',
|
|
898
905
|
stderr: '',
|
|
@@ -935,9 +942,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
935
942
|
}),
|
|
936
943
|
];
|
|
937
944
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
938
|
-
mockIssueRepository.
|
|
939
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
940
|
-
);
|
|
945
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
941
946
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
942
947
|
stdout: '',
|
|
943
948
|
stderr: '',
|
|
@@ -980,9 +985,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
980
985
|
}),
|
|
981
986
|
];
|
|
982
987
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
983
|
-
mockIssueRepository.
|
|
984
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
985
|
-
);
|
|
988
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
986
989
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
987
990
|
stdout: '',
|
|
988
991
|
stderr: '',
|
|
@@ -1025,9 +1028,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1025
1028
|
}),
|
|
1026
1029
|
];
|
|
1027
1030
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1028
|
-
mockIssueRepository.
|
|
1029
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1030
|
-
);
|
|
1031
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1031
1032
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1032
1033
|
stdout: '',
|
|
1033
1034
|
stderr: '',
|
|
@@ -1073,9 +1074,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1073
1074
|
}),
|
|
1074
1075
|
];
|
|
1075
1076
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1076
|
-
mockIssueRepository.
|
|
1077
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1078
|
-
);
|
|
1077
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1079
1078
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1080
1079
|
stdout: '',
|
|
1081
1080
|
stderr: '',
|
|
@@ -1126,9 +1125,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1126
1125
|
}),
|
|
1127
1126
|
];
|
|
1128
1127
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1129
|
-
mockIssueRepository.
|
|
1130
|
-
createMockStoryObjectMap(preparationIssues),
|
|
1131
|
-
);
|
|
1128
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(preparationIssues);
|
|
1132
1129
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1133
1130
|
stdout: '',
|
|
1134
1131
|
stderr: '',
|
|
@@ -1161,9 +1158,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1161
1158
|
}),
|
|
1162
1159
|
);
|
|
1163
1160
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1164
|
-
mockIssueRepository.
|
|
1165
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1166
|
-
);
|
|
1161
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1167
1162
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1168
1163
|
stdout: '',
|
|
1169
1164
|
stderr: '',
|
|
@@ -1195,9 +1190,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1195
1190
|
}),
|
|
1196
1191
|
);
|
|
1197
1192
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1198
|
-
mockIssueRepository.
|
|
1199
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1200
|
-
);
|
|
1193
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1201
1194
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1202
1195
|
stdout: '',
|
|
1203
1196
|
stderr: '',
|
|
@@ -1231,9 +1224,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1231
1224
|
}),
|
|
1232
1225
|
);
|
|
1233
1226
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1234
|
-
mockIssueRepository.
|
|
1235
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1236
|
-
);
|
|
1227
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1237
1228
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1238
1229
|
stdout: '',
|
|
1239
1230
|
stderr: '',
|
|
@@ -1297,9 +1288,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1297
1288
|
}),
|
|
1298
1289
|
);
|
|
1299
1290
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1300
|
-
mockIssueRepository.
|
|
1301
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1302
|
-
);
|
|
1291
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1303
1292
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1304
1293
|
stdout: '',
|
|
1305
1294
|
stderr: '',
|
|
@@ -1360,30 +1349,11 @@ describe('StartPreparationUseCase', () => {
|
|
|
1360
1349
|
state: 'OPEN',
|
|
1361
1350
|
});
|
|
1362
1351
|
|
|
1363
|
-
const workflowBlockerMap: StoryObjectMap = new Map();
|
|
1364
|
-
workflowBlockerMap.set('Workflow blocker', {
|
|
1365
|
-
story: {
|
|
1366
|
-
id: 'story-blocker',
|
|
1367
|
-
name: 'Workflow blocker',
|
|
1368
|
-
color: 'RED',
|
|
1369
|
-
description: '',
|
|
1370
|
-
},
|
|
1371
|
-
storyIssue: null,
|
|
1372
|
-
issues: [blockerIssue],
|
|
1373
|
-
});
|
|
1374
|
-
workflowBlockerMap.set('Default Story', {
|
|
1375
|
-
story: {
|
|
1376
|
-
id: 'story-1',
|
|
1377
|
-
name: 'Default Story',
|
|
1378
|
-
color: 'GRAY',
|
|
1379
|
-
description: '',
|
|
1380
|
-
},
|
|
1381
|
-
storyIssue: null,
|
|
1382
|
-
issues: [issueInBlockedRepo],
|
|
1383
|
-
});
|
|
1384
|
-
|
|
1385
1352
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1386
|
-
mockIssueRepository.
|
|
1353
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1354
|
+
blockerIssue,
|
|
1355
|
+
issueInBlockedRepo,
|
|
1356
|
+
]);
|
|
1387
1357
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1388
1358
|
stdout: '',
|
|
1389
1359
|
stderr: '',
|
|
@@ -1429,9 +1399,10 @@ describe('StartPreparationUseCase', () => {
|
|
|
1429
1399
|
});
|
|
1430
1400
|
|
|
1431
1401
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1432
|
-
mockIssueRepository.
|
|
1433
|
-
|
|
1434
|
-
|
|
1402
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1403
|
+
issueWithDependency,
|
|
1404
|
+
issueWithoutDependency,
|
|
1405
|
+
]);
|
|
1435
1406
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1436
1407
|
stdout: '',
|
|
1437
1408
|
stderr: '',
|
|
@@ -1481,12 +1452,10 @@ describe('StartPreparationUseCase', () => {
|
|
|
1481
1452
|
});
|
|
1482
1453
|
|
|
1483
1454
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1484
|
-
mockIssueRepository.
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
]),
|
|
1489
|
-
);
|
|
1455
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1456
|
+
issueWithFutureNextActionHour,
|
|
1457
|
+
issueWithoutNextActionHour,
|
|
1458
|
+
]);
|
|
1490
1459
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1491
1460
|
stdout: '',
|
|
1492
1461
|
stderr: '',
|
|
@@ -1539,12 +1508,10 @@ describe('StartPreparationUseCase', () => {
|
|
|
1539
1508
|
});
|
|
1540
1509
|
|
|
1541
1510
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1542
|
-
mockIssueRepository.
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
]),
|
|
1547
|
-
);
|
|
1511
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1512
|
+
issueWithFutureNextActionDate,
|
|
1513
|
+
issueWithoutNextActionDate,
|
|
1514
|
+
]);
|
|
1548
1515
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1549
1516
|
stdout: '',
|
|
1550
1517
|
stderr: '',
|
|
@@ -1590,9 +1557,9 @@ describe('StartPreparationUseCase', () => {
|
|
|
1590
1557
|
});
|
|
1591
1558
|
|
|
1592
1559
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1593
|
-
mockIssueRepository.
|
|
1594
|
-
|
|
1595
|
-
);
|
|
1560
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1561
|
+
issueWithTodayNextActionDate,
|
|
1562
|
+
]);
|
|
1596
1563
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1597
1564
|
stdout: '',
|
|
1598
1565
|
stderr: '',
|
|
@@ -1638,9 +1605,9 @@ describe('StartPreparationUseCase', () => {
|
|
|
1638
1605
|
});
|
|
1639
1606
|
|
|
1640
1607
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1641
|
-
mockIssueRepository.
|
|
1642
|
-
|
|
1643
|
-
);
|
|
1608
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1609
|
+
issueWithPastNextActionDate,
|
|
1610
|
+
]);
|
|
1644
1611
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1645
1612
|
stdout: '',
|
|
1646
1613
|
stderr: '',
|
|
@@ -1686,9 +1653,9 @@ describe('StartPreparationUseCase', () => {
|
|
|
1686
1653
|
});
|
|
1687
1654
|
|
|
1688
1655
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1689
|
-
mockIssueRepository.
|
|
1690
|
-
|
|
1691
|
-
);
|
|
1656
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1657
|
+
issueWithPastNextActionHour,
|
|
1658
|
+
]);
|
|
1692
1659
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1693
1660
|
stdout: '',
|
|
1694
1661
|
stderr: '',
|
|
@@ -1737,12 +1704,10 @@ describe('StartPreparationUseCase', () => {
|
|
|
1737
1704
|
});
|
|
1738
1705
|
|
|
1739
1706
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1740
|
-
mockIssueRepository.
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
]),
|
|
1745
|
-
);
|
|
1707
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1708
|
+
issueFromAllowedAuthor,
|
|
1709
|
+
issueFromNonAllowedAuthor,
|
|
1710
|
+
]);
|
|
1746
1711
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1747
1712
|
stdout: '',
|
|
1748
1713
|
stderr: '',
|
|
@@ -1788,9 +1753,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1788
1753
|
});
|
|
1789
1754
|
|
|
1790
1755
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1791
|
-
mockIssueRepository.
|
|
1792
|
-
createMockStoryObjectMap([issue1, issue2]),
|
|
1793
|
-
);
|
|
1756
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([issue1, issue2]);
|
|
1794
1757
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1795
1758
|
stdout: '',
|
|
1796
1759
|
stderr: '',
|
|
@@ -1834,9 +1797,10 @@ describe('StartPreparationUseCase', () => {
|
|
|
1834
1797
|
});
|
|
1835
1798
|
|
|
1836
1799
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1837
|
-
mockIssueRepository.
|
|
1838
|
-
|
|
1839
|
-
|
|
1800
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
1801
|
+
issueWithEmptyAuthor,
|
|
1802
|
+
issueWithKnownAuthor,
|
|
1803
|
+
]);
|
|
1840
1804
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1841
1805
|
stdout: '',
|
|
1842
1806
|
stderr: '',
|
|
@@ -1874,9 +1838,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1874
1838
|
});
|
|
1875
1839
|
|
|
1876
1840
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1877
|
-
mockIssueRepository.
|
|
1878
|
-
createMockStoryObjectMap([issueWithEmptyAuthor]),
|
|
1879
|
-
);
|
|
1841
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([issueWithEmptyAuthor]);
|
|
1880
1842
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1881
1843
|
stdout: '',
|
|
1882
1844
|
stderr: '',
|
|
@@ -1911,9 +1873,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1911
1873
|
}),
|
|
1912
1874
|
];
|
|
1913
1875
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1914
|
-
mockIssueRepository.
|
|
1915
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1916
|
-
);
|
|
1876
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1917
1877
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1918
1878
|
stdout: '',
|
|
1919
1879
|
stderr: '',
|
|
@@ -1959,9 +1919,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
1959
1919
|
}),
|
|
1960
1920
|
];
|
|
1961
1921
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1962
|
-
mockIssueRepository.
|
|
1963
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
1964
|
-
);
|
|
1922
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
1965
1923
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
1966
1924
|
stdout: '',
|
|
1967
1925
|
stderr: '',
|
|
@@ -2007,9 +1965,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2007
1965
|
}),
|
|
2008
1966
|
];
|
|
2009
1967
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2010
|
-
mockIssueRepository.
|
|
2011
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
2012
|
-
);
|
|
1968
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
2013
1969
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2014
1970
|
stdout: '',
|
|
2015
1971
|
stderr: '',
|
|
@@ -2075,9 +2031,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2075
2031
|
}),
|
|
2076
2032
|
];
|
|
2077
2033
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2078
|
-
mockIssueRepository.
|
|
2079
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
2080
|
-
);
|
|
2034
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
2081
2035
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2082
2036
|
stdout: '',
|
|
2083
2037
|
stderr: '',
|
|
@@ -2140,9 +2094,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2140
2094
|
itemId: 'item-regression',
|
|
2141
2095
|
});
|
|
2142
2096
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2143
|
-
mockIssueRepository.
|
|
2144
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2145
|
-
);
|
|
2097
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2146
2098
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2147
2099
|
stdout: '',
|
|
2148
2100
|
stderr: '',
|
|
@@ -2201,9 +2153,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2201
2153
|
status: 'Awaiting Workspace',
|
|
2202
2154
|
});
|
|
2203
2155
|
mockProjectRepository.getByUrl.mockResolvedValue(projectWithoutPreparation);
|
|
2204
|
-
mockIssueRepository.
|
|
2205
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2206
|
-
);
|
|
2156
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2207
2157
|
const consoleErrorSpy = jest
|
|
2208
2158
|
.spyOn(console, 'error')
|
|
2209
2159
|
.mockImplementation(() => {});
|
|
@@ -2230,11 +2180,9 @@ describe('StartPreparationUseCase', () => {
|
|
|
2230
2180
|
consoleErrorSpy.mockRestore();
|
|
2231
2181
|
});
|
|
2232
2182
|
|
|
2233
|
-
it('should pass allowIssueCacheMinutes to
|
|
2183
|
+
it('should pass allowIssueCacheMinutes to getAllOpened', async () => {
|
|
2234
2184
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2235
|
-
mockIssueRepository.
|
|
2236
|
-
createMockStoryObjectMap([]),
|
|
2237
|
-
);
|
|
2185
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([]);
|
|
2238
2186
|
|
|
2239
2187
|
await useCase.run({
|
|
2240
2188
|
projectUrl: 'https://github.com/user/repo',
|
|
@@ -2250,7 +2198,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2250
2198
|
labelsAsLlmAgentName: null,
|
|
2251
2199
|
});
|
|
2252
2200
|
|
|
2253
|
-
expect(mockIssueRepository.
|
|
2201
|
+
expect(mockIssueRepository.getAllOpened).toHaveBeenCalledWith(
|
|
2254
2202
|
expect.objectContaining({ id: 'project-1' }),
|
|
2255
2203
|
5,
|
|
2256
2204
|
);
|
|
@@ -2274,9 +2222,10 @@ describe('StartPreparationUseCase', () => {
|
|
|
2274
2222
|
});
|
|
2275
2223
|
|
|
2276
2224
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2277
|
-
mockIssueRepository.
|
|
2278
|
-
|
|
2279
|
-
|
|
2225
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([
|
|
2226
|
+
closedIssue,
|
|
2227
|
+
openIssue,
|
|
2228
|
+
]);
|
|
2280
2229
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2281
2230
|
stdout: '',
|
|
2282
2231
|
stderr: '',
|
|
@@ -2313,9 +2262,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2313
2262
|
itemId: 'item-1',
|
|
2314
2263
|
});
|
|
2315
2264
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2316
|
-
mockIssueRepository.
|
|
2317
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2318
|
-
);
|
|
2265
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2319
2266
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2320
2267
|
stdout: '',
|
|
2321
2268
|
stderr: '',
|
|
@@ -2390,9 +2337,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2390
2337
|
}),
|
|
2391
2338
|
];
|
|
2392
2339
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2393
|
-
mockIssueRepository.
|
|
2394
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
2395
|
-
);
|
|
2340
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
2396
2341
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2397
2342
|
stdout: '',
|
|
2398
2343
|
stderr: '',
|
|
@@ -2464,9 +2409,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2464
2409
|
itemId: 'item-1',
|
|
2465
2410
|
});
|
|
2466
2411
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2467
|
-
mockIssueRepository.
|
|
2468
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2469
|
-
);
|
|
2412
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2470
2413
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2471
2414
|
stdout: '',
|
|
2472
2415
|
stderr: '',
|
|
@@ -2507,9 +2450,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2507
2450
|
itemId: 'item-1',
|
|
2508
2451
|
});
|
|
2509
2452
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2510
|
-
mockIssueRepository.
|
|
2511
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2512
|
-
);
|
|
2453
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2513
2454
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2514
2455
|
stdout: '',
|
|
2515
2456
|
stderr: '',
|
|
@@ -2580,9 +2521,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2580
2521
|
itemId: 'item-1',
|
|
2581
2522
|
});
|
|
2582
2523
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2583
|
-
mockIssueRepository.
|
|
2584
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2585
|
-
);
|
|
2524
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2586
2525
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2587
2526
|
stdout: '',
|
|
2588
2527
|
stderr: '',
|
|
@@ -2642,9 +2581,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2642
2581
|
itemId: 'item-1',
|
|
2643
2582
|
});
|
|
2644
2583
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2645
|
-
mockIssueRepository.
|
|
2646
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2647
|
-
);
|
|
2584
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2648
2585
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2649
2586
|
stdout: '',
|
|
2650
2587
|
stderr: '',
|
|
@@ -2710,9 +2647,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2710
2647
|
itemId: 'item-1',
|
|
2711
2648
|
});
|
|
2712
2649
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2713
|
-
mockIssueRepository.
|
|
2714
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2715
|
-
);
|
|
2650
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2716
2651
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2717
2652
|
stdout: '',
|
|
2718
2653
|
stderr: '',
|
|
@@ -2796,9 +2731,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2796
2731
|
}),
|
|
2797
2732
|
];
|
|
2798
2733
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2799
|
-
mockIssueRepository.
|
|
2800
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
2801
|
-
);
|
|
2734
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
2802
2735
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2803
2736
|
stdout: '',
|
|
2804
2737
|
stderr: '',
|
|
@@ -2888,9 +2821,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2888
2821
|
}),
|
|
2889
2822
|
);
|
|
2890
2823
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2891
|
-
mockIssueRepository.
|
|
2892
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
2893
|
-
);
|
|
2824
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
2894
2825
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2895
2826
|
stdout: '',
|
|
2896
2827
|
stderr: '',
|
|
@@ -2941,9 +2872,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
2941
2872
|
itemId: 'item-1',
|
|
2942
2873
|
});
|
|
2943
2874
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
2944
|
-
mockIssueRepository.
|
|
2945
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
2946
|
-
);
|
|
2875
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
2947
2876
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
2948
2877
|
stdout: '',
|
|
2949
2878
|
stderr: '',
|
|
@@ -3003,9 +2932,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3003
2932
|
itemId: 'item-1',
|
|
3004
2933
|
});
|
|
3005
2934
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3006
|
-
mockIssueRepository.
|
|
3007
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3008
|
-
);
|
|
2935
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3009
2936
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3010
2937
|
stdout: '',
|
|
3011
2938
|
stderr: '',
|
|
@@ -3065,9 +2992,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3065
2992
|
itemId: 'item-1',
|
|
3066
2993
|
});
|
|
3067
2994
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3068
|
-
mockIssueRepository.
|
|
3069
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3070
|
-
);
|
|
2995
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3071
2996
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3072
2997
|
stdout: '',
|
|
3073
2998
|
stderr: '',
|
|
@@ -3127,9 +3052,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3127
3052
|
itemId: 'item-1',
|
|
3128
3053
|
});
|
|
3129
3054
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3130
|
-
mockIssueRepository.
|
|
3131
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3132
|
-
);
|
|
3055
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3133
3056
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3134
3057
|
stdout: '',
|
|
3135
3058
|
stderr: '',
|
|
@@ -3194,9 +3117,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3194
3117
|
itemId: 'item-1',
|
|
3195
3118
|
});
|
|
3196
3119
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3197
|
-
mockIssueRepository.
|
|
3198
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3199
|
-
);
|
|
3120
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3200
3121
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3201
3122
|
stdout: '',
|
|
3202
3123
|
stderr: '',
|
|
@@ -3239,9 +3160,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3239
3160
|
itemId: 'item-1',
|
|
3240
3161
|
});
|
|
3241
3162
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3242
|
-
mockIssueRepository.
|
|
3243
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3244
|
-
);
|
|
3163
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3245
3164
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3246
3165
|
stdout: '',
|
|
3247
3166
|
stderr: '',
|
|
@@ -3304,9 +3223,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3304
3223
|
itemId: 'item-1',
|
|
3305
3224
|
});
|
|
3306
3225
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3307
|
-
mockIssueRepository.
|
|
3308
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3309
|
-
);
|
|
3226
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3310
3227
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3311
3228
|
stdout: '',
|
|
3312
3229
|
stderr: '',
|
|
@@ -3369,9 +3286,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3369
3286
|
itemId: 'item-1',
|
|
3370
3287
|
});
|
|
3371
3288
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3372
|
-
mockIssueRepository.
|
|
3373
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3374
|
-
);
|
|
3289
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3375
3290
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3376
3291
|
stdout: '',
|
|
3377
3292
|
stderr: '',
|
|
@@ -3434,9 +3349,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3434
3349
|
itemId: 'item-1',
|
|
3435
3350
|
});
|
|
3436
3351
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3437
|
-
mockIssueRepository.
|
|
3438
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3439
|
-
);
|
|
3352
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3440
3353
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3441
3354
|
stdout: '',
|
|
3442
3355
|
stderr: '',
|
|
@@ -3499,9 +3412,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3499
3412
|
itemId: 'item-1',
|
|
3500
3413
|
});
|
|
3501
3414
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3502
|
-
mockIssueRepository.
|
|
3503
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3504
|
-
);
|
|
3415
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3505
3416
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3506
3417
|
stdout: '',
|
|
3507
3418
|
stderr: '',
|
|
@@ -3572,9 +3483,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3572
3483
|
itemId: 'item-1',
|
|
3573
3484
|
});
|
|
3574
3485
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3575
|
-
mockIssueRepository.
|
|
3576
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3577
|
-
);
|
|
3486
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3578
3487
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3579
3488
|
stdout: '',
|
|
3580
3489
|
stderr: '',
|
|
@@ -3655,9 +3564,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3655
3564
|
}),
|
|
3656
3565
|
];
|
|
3657
3566
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3658
|
-
mockIssueRepository.
|
|
3659
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
3660
|
-
);
|
|
3567
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
3661
3568
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3662
3569
|
stdout: '',
|
|
3663
3570
|
stderr: '',
|
|
@@ -3723,9 +3630,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3723
3630
|
itemId: 'item-1',
|
|
3724
3631
|
});
|
|
3725
3632
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3726
|
-
mockIssueRepository.
|
|
3727
|
-
createMockStoryObjectMap([awaitingIssue]),
|
|
3728
|
-
);
|
|
3633
|
+
mockIssueRepository.getAllOpened.mockResolvedValue([awaitingIssue]);
|
|
3729
3634
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3730
3635
|
stdout: '',
|
|
3731
3636
|
stderr: '',
|
|
@@ -3797,9 +3702,7 @@ describe('StartPreparationUseCase', () => {
|
|
|
3797
3702
|
}),
|
|
3798
3703
|
];
|
|
3799
3704
|
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
3800
|
-
mockIssueRepository.
|
|
3801
|
-
createMockStoryObjectMap(awaitingIssues),
|
|
3802
|
-
);
|
|
3705
|
+
mockIssueRepository.getAllOpened.mockResolvedValue(awaitingIssues);
|
|
3803
3706
|
mockLocalCommandRunner.runCommand.mockResolvedValue({
|
|
3804
3707
|
stdout: '',
|
|
3805
3708
|
stderr: '',
|
|
@@ -3924,7 +3827,7 @@ describe('StartPreparationUseCase.buildRotationOrder', () => {
|
|
|
3924
3827
|
const mockIssueRepositoryForRotation: Mocked<
|
|
3925
3828
|
Pick<
|
|
3926
3829
|
IssueRepository,
|
|
3927
|
-
| '
|
|
3830
|
+
| 'getAllOpened'
|
|
3928
3831
|
| 'updateStatus'
|
|
3929
3832
|
| 'findRelatedOpenPRs'
|
|
3930
3833
|
| 'getOpenPullRequest'
|
|
@@ -3933,7 +3836,7 @@ describe('StartPreparationUseCase.buildRotationOrder', () => {
|
|
|
3933
3836
|
| 'createCommentByUrl'
|
|
3934
3837
|
>
|
|
3935
3838
|
> = {
|
|
3936
|
-
|
|
3839
|
+
getAllOpened: jest.fn(),
|
|
3937
3840
|
updateStatus: jest.fn(),
|
|
3938
3841
|
findRelatedOpenPRs: jest.fn(),
|
|
3939
3842
|
getOpenPullRequest: jest.fn(),
|