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