Skip to content

Commit 9116aaa

Browse files
committed
CCM-11889: update test auth
1 parent 79b631a commit 9116aaa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test-team/helpers/auth/cognito-auth-helper.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type UserIdentityAttributes =
2424

2525
type TestUserStaticDetails = {
2626
userId: string;
27+
internalUserId: string;
2728
clientKey: ClientKey;
2829
/**
2930
* If `userAttributes` is omitted, user will be created with full identity attributes:
@@ -55,6 +56,7 @@ export const testUsers: Record<string, TestUserStaticDetails> = {
5556
*/
5657
User1: {
5758
userId: 'User1',
59+
internalUserId: 'InternalUser1',
5860
clientKey: 'Client1',
5961
},
6062
/**
@@ -63,6 +65,7 @@ export const testUsers: Record<string, TestUserStaticDetails> = {
6365
*/
6466
User2: {
6567
userId: 'User2',
68+
internalUserId: 'InternalUser2',
6669
clientKey: 'Client5',
6770
userAttributes: ['given_name', 'family_name'],
6871
},
@@ -72,6 +75,7 @@ export const testUsers: Record<string, TestUserStaticDetails> = {
7275
*/
7376
User3: {
7477
userId: 'User3',
78+
internalUserId: 'InternalUser3',
7579
clientKey: 'Client2',
7680
},
7781
/**
@@ -80,6 +84,7 @@ export const testUsers: Record<string, TestUserStaticDetails> = {
8084
*/
8185
User4: {
8286
userId: 'User4',
87+
internalUserId: 'InternalUser4',
8388
clientKey: 'Client3',
8489
},
8590
/**
@@ -88,6 +93,7 @@ export const testUsers: Record<string, TestUserStaticDetails> = {
8893
*/
8994
User5: {
9095
userId: 'User5',
96+
internalUserId: 'InternalUser5',
9197
clientKey: 'Client1',
9298
userAttributes: [],
9399
},
@@ -96,25 +102,29 @@ export const testUsers: Record<string, TestUserStaticDetails> = {
96102
*/
97103
User6: {
98104
userId: 'User6',
105+
internalUserId: 'InternalUser6',
99106
clientKey: 'Client4',
100107
},
101108
/**
102109
* User7 shares a client with the primary user (User1)
103110
*/
104111
User7: {
105112
userId: 'User7',
113+
internalUserId: 'InternalUser7',
106114
clientKey: 'Client1',
107115
},
108116
/**
109117
* User8 has a client with no client name set
110118
*/
111119
User8: {
112120
userId: 'User8',
121+
internalUserId: 'InternalUser8',
113122
clientKey: 'Client6',
114123
},
115124

116125
UserWithMultipleCampaigns: {
117126
userId: 'UserWithMultipleCampaigns',
127+
internalUserId: 'InternalUserMultipleCampaigns',
118128
clientKey: 'ClientWithMultipleCampaigns',
119129
},
120130

@@ -123,6 +133,7 @@ export const testUsers: Record<string, TestUserStaticDetails> = {
123133
*/
124134
UserRoutingEnabled: {
125135
userId: 'UserWithRoutingEnabled',
136+
internalUserId: 'InternalUserRoutingEnabled',
126137
clientKey: 'ClientRoutingEnabled',
127138
},
128139
};
@@ -287,6 +298,7 @@ export class CognitoAuthHelper {
287298
const { name: clientName, campaignIds } = clientConfig ?? {};
288299

289300
const clientAttributes = [
301+
{ Name: 'custom:nhs_notify_user_id', Value: userDetails.internalUserId },
290302
{ Name: 'custom:sbx_client_id', Value: clientId },
291303
...(clientName
292304
? [{ Name: 'custom:sbx_client_name', Value: clientName }]
@@ -350,6 +362,7 @@ export class CognitoAuthHelper {
350362
clientName,
351363
identityAttributes,
352364
password: tempPassword,
365+
internalUserId: userDetails.internalUserId,
353366
}
354367
);
355368
}

0 commit comments

Comments
 (0)