Skip to content

Commit 51da0af

Browse files
author
Francis
committed
cognito
Signed-off-by: Francis <colifran@amazon.com>
1 parent 06ab1dd commit 51da0af

7 files changed

Lines changed: 170 additions & 10 deletions

File tree

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.assets.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integ-cognito.template.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,14 @@
918918
"Export": {
919919
"Name": "integ-cognito:ExportsOutputRefSignin352C80E64BA58F71"
920920
}
921+
},
922+
"ExportsOutputRefUserPool6BA7E5F296FD7236": {
923+
"Value": {
924+
"Ref": "UserPool6BA7E5F2"
925+
},
926+
"Export": {
927+
"Name": "integ-cognito:ExportsOutputRefUserPool6BA7E5F296FD7236"
928+
}
921929
}
922930
},
923931
"Parameters": {

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.assets.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/integtestcognitoDefaultTestDeployAssert6F2623C9.template.json

Lines changed: 51 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/manifest.json

Lines changed: 20 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.js.snapshot/tree.json

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2-actions/test/integ.cognito.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,12 @@ const test = new integ.IntegTest(app, 'integ-test-cognito', {
191191
testCases: [testCase],
192192
diffAssets: true,
193193
});
194-
const testUser = new CognitoUser(testCase, 'User', {
194+
const cognitoUserProps = {
195195
userPool: testCase.userPool,
196196
username: 'test-user@example.com',
197197
password: 'TestUser@123',
198-
});
198+
};
199+
const testUser = new CognitoUser(testCase, 'User', cognitoUserProps);
199200
// this function signs in to the website and returns text content of the authenticated page body
200201
const signinFunction = new lambda.Function(testCase, 'Signin', {
201202
functionName: 'cdk-integ-alb-cognito-signin-handler',
@@ -216,5 +217,26 @@ const invoke = test.assertions.invokeFunction({
216217
invoke.expect(integ.ExpectedResult.objectLike({
217218
Payload: '"Authenticated"',
218219
}));
219-
220+
const cognitoUser = test.assertions.awsApiCall('CognitoIdentityServiceProvider', 'adminGetUser', {
221+
UserPoolId: cognitoUserProps.userPool.userPoolId,
222+
Username: cognitoUserProps.username,
223+
});
224+
cognitoUser.expect(integ.ExpectedResult.objectLike({
225+
UserStatus: 'CONFIRMED',
226+
Enabled: true,
227+
UserAttributes: [
228+
{
229+
Name: 'email',
230+
Value: cognitoUserProps.username,
231+
},
232+
{
233+
Name: 'email_verified',
234+
Value: 'true',
235+
},
236+
{
237+
Name: 'sub',
238+
Value: integ.Match.stringLikeRegexp('^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'),
239+
},
240+
],
241+
}));
220242
app.synth();

0 commit comments

Comments
 (0)