Skip to content

Commit 2b3abeb

Browse files
authored
feat: add failed at startup checksuite handling (#1723)
Signed-off-by: Adam Setch <[email protected]>
1 parent 75f08c1 commit 2b3abeb

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/renderer/utils/subject.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ describe('renderer/utils/subject.ts', () => {
7070
});
7171
});
7272

73+
it('failed at startup check suite state', async () => {
74+
const mockNotification = partialMockNotification({
75+
title: 'Demo workflow run failed at startup for main branch',
76+
type: 'CheckSuite',
77+
});
78+
79+
const result = await getGitifySubjectDetails(mockNotification);
80+
81+
expect(result).toEqual({
82+
state: 'failure',
83+
user: null,
84+
});
85+
});
86+
7387
it('multiple attempts failed check suite state', async () => {
7488
const mockNotification = partialMockNotification({
7589
title: 'Demo workflow run, Attempt #3 failed for main branch',

src/renderer/utils/subject.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function getCheckSuiteStatus(statusDisplayName: string): CheckSuiteStatus {
9292
case 'cancelled':
9393
return 'cancelled';
9494
case 'failed':
95+
case 'failed at startup':
9596
return 'failure';
9697
case 'skipped':
9798
return 'skipped';

0 commit comments

Comments
 (0)