Skip to content

Commit

Permalink
Fix GitHubUtilsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jun 23, 2023
1 parent 1728f19 commit f16da28
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions tests/unit/GithubUtilsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @jest-environment node
*/
const core = require('@actions/core');
const CONST = require('../../.github/libs/CONST');
const GithubUtils = require('../../.github/libs/GithubUtils');

const mockGetInput = jest.fn();
Expand Down Expand Up @@ -280,29 +279,22 @@ describe('GithubUtils', () => {
},
{
number: 4,
title: 'Test Automated PR',
html_url: 'https://github.com/Expensify/App/pull/4',
user: {login: CONST.OS_BOTIFY},
labels: [{name: 'automerge'}],
},
{
number: 5,
title: '[NO QA] Test No QA PR uppercase',
html_url: 'https://github.com/Expensify/App/pull/5',
html_url: 'https://github.com/Expensify/App/pull/4',
user: {login: 'testUser'},
labels: [],
},
{
number: 6,
number: 5,
title: '[NoQa] Test No QA PR Title Case',
html_url: 'https://github.com/Expensify/App/pull/6',
html_url: 'https://github.com/Expensify/App/pull/5',
user: {login: 'testUser'},
labels: [],
},
{
number: 7,
number: 6,
title: '[Internal QA] Test Internal QA PR',
html_url: 'https://github.com/Expensify/App/pull/7',
html_url: 'https://github.com/Expensify/App/pull/6',
user: {login: 'testUser'},
labels: [
{
Expand All @@ -324,9 +316,9 @@ describe('GithubUtils', () => {
],
},
{
number: 8,
number: 7,
title: '[Internal QA] Another Test Internal QA PR',
html_url: 'https://github.com/Expensify/App/pull/8',
html_url: 'https://github.com/Expensify/App/pull/7',
user: {login: 'testUser'},
labels: [
{
Expand Down Expand Up @@ -370,15 +362,14 @@ describe('GithubUtils', () => {
'https://github.com/Expensify/App/pull/2',
'https://github.com/Expensify/App/pull/3',
'https://github.com/Expensify/App/pull/1',
'https://github.com/Expensify/App/pull/4', // Automated
'https://github.com/Expensify/App/pull/3', // This is an intentional duplicate for testing duplicates
'https://github.com/Expensify/App/pull/4', // No QA
'https://github.com/Expensify/App/pull/5', // No QA
'https://github.com/Expensify/App/pull/6', // No QA
];

const internalQAPRList = [
'https://github.com/Expensify/App/pull/6', // Internal QA
'https://github.com/Expensify/App/pull/7', // Internal QA
'https://github.com/Expensify/App/pull/8', // Internal QA
];

const baseDeployBlockerList = ['https://github.com/Expensify/App/pull/3', 'https://github.com/Expensify/App/issues/4'];
Expand Down Expand Up @@ -409,8 +400,8 @@ describe('GithubUtils', () => {
`${closedCheckbox}${basePRList[2]}` +
`${lineBreak}${closedCheckbox}${basePRList[0]}` +
`${lineBreak}${closedCheckbox}${basePRList[1]}` +
`${lineBreak}${closedCheckbox}${basePRList[4]}` +
`${lineBreak}${closedCheckbox}${basePRList[5]}` +
`${lineBreak}${closedCheckbox}${basePRList[6]}` +
`${lineBreak}`;

test('Test no verified PRs', () =>
Expand All @@ -420,8 +411,8 @@ describe('GithubUtils', () => {
`${openCheckbox}${basePRList[2]}` +
`${lineBreak}${openCheckbox}${basePRList[0]}` +
`${lineBreak}${openCheckbox}${basePRList[1]}` +
`${lineBreak}${closedCheckbox}${basePRList[4]}` +
`${lineBreak}${closedCheckbox}${basePRList[5]}` +
`${lineBreak}${closedCheckbox}${basePRList[6]}` +
`${lineBreakDouble}${deployerVerificationsHeader}` +
`${lineBreak}${openCheckbox}${timingDashboardVerification}` +
`${lineBreak}${openCheckbox}${firebaseVerification}` +
Expand All @@ -437,8 +428,8 @@ describe('GithubUtils', () => {
`${openCheckbox}${basePRList[2]}` +
`${lineBreak}${closedCheckbox}${basePRList[0]}` +
`${lineBreak}${openCheckbox}${basePRList[1]}` +
`${lineBreak}${closedCheckbox}${basePRList[4]}` +
`${lineBreak}${closedCheckbox}${basePRList[5]}` +
`${lineBreak}${closedCheckbox}${basePRList[6]}` +
`${lineBreakDouble}${deployerVerificationsHeader}` +
`${lineBreak}${openCheckbox}${timingDashboardVerification}` +
`${lineBreak}${openCheckbox}${firebaseVerification}` +
Expand Down Expand Up @@ -496,8 +487,8 @@ describe('GithubUtils', () => {
`${closedCheckbox}${basePRList[2]}` +
`${lineBreak}${closedCheckbox}${basePRList[0]}` +
`${lineBreak}${closedCheckbox}${basePRList[1]}` +
`${lineBreak}${closedCheckbox}${basePRList[4]}` +
`${lineBreak}${closedCheckbox}${basePRList[5]}` +
`${lineBreak}${closedCheckbox}${basePRList[6]}` +
`${lineBreakDouble}${deployBlockerHeader}` +
`${lineBreak}${closedCheckbox}${baseDeployBlockerList[0]}` +
`${lineBreak}${closedCheckbox}${baseDeployBlockerList[1]}` +
Expand All @@ -516,8 +507,8 @@ describe('GithubUtils', () => {
`${openCheckbox}${basePRList[2]}` +
`${lineBreak}${openCheckbox}${basePRList[0]}` +
`${lineBreak}${openCheckbox}${basePRList[1]}` +
`${lineBreak}${closedCheckbox}${basePRList[4]}` +
`${lineBreak}${closedCheckbox}${basePRList[5]}` +
`${lineBreak}${closedCheckbox}${basePRList[6]}` +
`${lineBreak}${internalQAHeader}` +
`${lineBreak}${openCheckbox}${internalQAPRList[0]}${assignOctocatHubot}` +
`${lineBreak}${openCheckbox}${internalQAPRList[1]}${assignOctocatHubot}` +
Expand All @@ -536,8 +527,8 @@ describe('GithubUtils', () => {
`${openCheckbox}${basePRList[2]}` +
`${lineBreak}${openCheckbox}${basePRList[0]}` +
`${lineBreak}${openCheckbox}${basePRList[1]}` +
`${lineBreak}${closedCheckbox}${basePRList[4]}` +
`${lineBreak}${closedCheckbox}${basePRList[5]}` +
`${lineBreak}${closedCheckbox}${basePRList[6]}` +
`${lineBreak}${internalQAHeader}` +
`${lineBreak}${closedCheckbox}${internalQAPRList[0]}${assignOctocatHubot}` +
`${lineBreak}${openCheckbox}${internalQAPRList[1]}${assignOctocatHubot}` +
Expand Down

0 comments on commit f16da28

Please sign in to comment.