diff --git a/src/services/github.test.ts b/src/services/github.test.ts index 2a9638c..76f3997 100644 --- a/src/services/github.test.ts +++ b/src/services/github.test.ts @@ -39,7 +39,7 @@ describe('GitHub Service', () => { activities: [{ id: 'issue-1-2', type: 'issue', - status: 'success', + status: 'pr_open', timestamp: '2023-11-28T00:01:00Z', url: 'https://github.com/All-Hands-AI/OpenHands/issues/1#comment-2', prUrl: 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2', @@ -47,11 +47,6 @@ describe('GitHub Service', () => { }], lastUpdated: '2023-11-28T00:01:00Z' }); - } else if (url === 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2') { - return createMockResponse({ - state: 'open', - merged: false - }); } throw new Error(`Unexpected URL: ${url}`); }); @@ -78,7 +73,7 @@ describe('GitHub Service', () => { activities: [{ id: 'issue-1-2', type: 'issue', - status: 'failure', + status: 'no_pr', timestamp: '2023-11-28T00:01:00Z', url: 'https://github.com/All-Hands-AI/OpenHands/issues/1#comment-2', description: 'The workflow to fix this issue encountered an error. Openhands failed to create any code changes.' @@ -143,7 +138,7 @@ describe('GitHub Service', () => { activities: [{ id: 'issue-1-2', type: 'issue', - status: 'success', + status: 'no_pr', timestamp: '2023-11-28T00:01:00Z', url: 'https://github.com/All-Hands-AI/OpenHands/issues/1#comment-2', description: 'Working on the issue...' @@ -173,7 +168,7 @@ describe('GitHub Service', () => { activities: [{ id: 'issue-1-2', type: 'issue', - status: 'success', + status: 'pr_open', timestamp: '2023-11-28T00:01:00Z', url: 'https://github.com/All-Hands-AI/OpenHands/issues/1#comment-2', prUrl: 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2', @@ -181,11 +176,6 @@ describe('GitHub Service', () => { }], lastUpdated: '2023-11-28T00:01:00Z' }); - } else if (url === 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2') { - return createMockResponse({ - state: 'open', - merged: false - }); } throw new Error(`Unexpected URL: ${url}`); }); @@ -209,7 +199,7 @@ describe('GitHub Service', () => { activities: [{ id: 'issue-1-2', type: 'issue', - status: 'success', + status: 'pr_merged', timestamp: '2023-11-28T00:01:00Z', url: 'https://github.com/All-Hands-AI/OpenHands/issues/1#comment-2', prUrl: 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2', @@ -217,11 +207,6 @@ describe('GitHub Service', () => { }], lastUpdated: '2023-11-28T00:01:00Z' }); - } else if (url === 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2') { - return createMockResponse({ - state: 'closed', - merged: true - }); } throw new Error(`Unexpected URL: ${url}`); }); @@ -245,7 +230,7 @@ describe('GitHub Service', () => { activities: [{ id: 'issue-1-2', type: 'issue', - status: 'success', + status: 'pr_closed', timestamp: '2023-11-28T00:01:00Z', url: 'https://github.com/All-Hands-AI/OpenHands/issues/1#comment-2', prUrl: 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2', @@ -253,11 +238,6 @@ describe('GitHub Service', () => { }], lastUpdated: '2023-11-28T00:01:00Z' }); - } else if (url === 'https://api.github.com/repos/All-Hands-AI/OpenHands/pulls/2') { - return createMockResponse({ - state: 'closed', - merged: false - }); } throw new Error(`Unexpected URL: ${url}`); });