Skip to content

Commit e7bc939

Browse files
committed
Fix test
1 parent 245633e commit e7bc939

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

test/local/functional/domain/github/webPush/webPushEvents.test.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from '../../../../../examples/cicada/githubDomainObjects'
88
import {
99
GITHUB_ACCOUNT_MEMBERSHIP,
10+
GITHUB_LATEST_WORKFLOW_RUN_EVENT,
1011
WEB_PUSH_SUBSCRIPTION
1112
} from '../../../../../../src/app/domain/entityStore/entityTypes'
1213
import { processEventBridgeWebPushEvent } from '../../../../../../src/app/domain/webPush/webPushEventBridgeEventProcessor'
@@ -35,6 +36,50 @@ test('newWorkflowRunEvent', async () => {
3536
}
3637
]
3738
)
39+
appState.dynamoDB.stubAllPagesQueries.addResponse(
40+
{
41+
TableName: 'fakeGithubAccountMemberships',
42+
KeyConditionExpression: 'GSI1PK = :pk',
43+
IndexName: 'GSI1',
44+
ExpressionAttributeValues: { ':pk': 'USER#162360409' }
45+
},
46+
[
47+
{
48+
$metadata: {},
49+
Items: [{ ...testTestUserMembershipOfOrg, _et: GITHUB_ACCOUNT_MEMBERSHIP }]
50+
}
51+
]
52+
)
53+
appState.dynamoDB.stubAllPagesQueries.addResponse(
54+
{
55+
TableName: 'fakeGithubAccountMemberships',
56+
KeyConditionExpression: 'GSI1PK = :pk',
57+
IndexName: 'GSI1',
58+
ExpressionAttributeValues: { ':pk': 'USER#49635' }
59+
},
60+
[
61+
{
62+
$metadata: {},
63+
Items: [{ ...testMikeRobertsUserMembershipOfOrg, _et: GITHUB_ACCOUNT_MEMBERSHIP }]
64+
}
65+
]
66+
)
67+
68+
appState.dynamoDB.stubAllPagesQueries.addResponse(
69+
{
70+
TableName: 'fakeGithubLatestWorkflowRunsTable',
71+
KeyConditionExpression: 'GSI1PK = :pk',
72+
IndexName: 'GSI1',
73+
ExpressionAttributeValues: { ':pk': 'ACCOUNT#162483619' },
74+
ScanIndexForward: false
75+
},
76+
[
77+
{
78+
$metadata: {},
79+
Items: [{ ...testOrgTestRepoOneWorkflowRunThree, _et: GITHUB_LATEST_WORKFLOW_RUN_EVENT }]
80+
}
81+
]
82+
)
3883

3984
appState.dynamoDB.stubAllPagesQueries.addResponse(
4085
{

0 commit comments

Comments
 (0)