forked from jagregory/cognito-local
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
135 changed files
with
1,708 additions
and
1,718 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,46 +7,42 @@ describe( | |
it("updates a user's attributes", async () => { | ||
const client = Cognito(); | ||
|
||
await client | ||
.adminCreateUser({ | ||
UserAttributes: [ | ||
{ Name: "email", Value: "[email protected]" }, | ||
{ Name: "custom:example", Value: "1" }, | ||
], | ||
Username: "abc", | ||
UserPoolId: "test", | ||
DesiredDeliveryMediums: ["EMAIL"], | ||
}); | ||
await client.adminCreateUser({ | ||
UserAttributes: [ | ||
{ Name: "email", Value: "[email protected]" }, | ||
{ Name: "custom:example", Value: "1" }, | ||
], | ||
Username: "abc", | ||
UserPoolId: "test", | ||
DesiredDeliveryMediums: ["EMAIL"], | ||
}); | ||
|
||
let user = await client | ||
.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
let user = await client.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
expect(user.UserAttributes).toEqual([ | ||
{ Name: "sub", Value: expect.stringMatching(UUID) }, | ||
{ Name: "email", Value: "[email protected]" }, | ||
{ Name: "custom:example", Value: "1" }, | ||
]); | ||
|
||
await client | ||
.adminDeleteUserAttributes({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
UserAttributeNames: ["custom:example"], | ||
}); | ||
await client.adminDeleteUserAttributes({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
UserAttributeNames: ["custom:example"], | ||
}); | ||
|
||
user = await client | ||
.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
user = await client.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
expect(user.UserAttributes).toEqual([ | ||
{ Name: "sub", Value: expect.stringMatching(UUID) }, | ||
{ Name: "email", Value: "[email protected]" }, | ||
]); | ||
}); | ||
}) | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,30 +6,27 @@ describe( | |
it("updates a user's attributes", async () => { | ||
const client = Cognito(); | ||
|
||
await client | ||
.adminCreateUser({ | ||
UserAttributes: [ | ||
{ Name: "email", Value: "[email protected]" }, | ||
{ Name: "custom:example", Value: "1" }, | ||
], | ||
Username: "abc", | ||
UserPoolId: "test", | ||
DesiredDeliveryMediums: ["EMAIL"], | ||
}); | ||
await client.adminCreateUser({ | ||
UserAttributes: [ | ||
{ Name: "email", Value: "[email protected]" }, | ||
{ Name: "custom:example", Value: "1" }, | ||
], | ||
Username: "abc", | ||
UserPoolId: "test", | ||
DesiredDeliveryMediums: ["EMAIL"], | ||
}); | ||
|
||
await client | ||
.adminDisableUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
await client.adminDisableUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
const user = await client | ||
.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
const user = await client.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
expect(user.Enabled).toEqual(false); | ||
}); | ||
}) | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,44 +6,39 @@ describe( | |
it("updates a user's attributes", async () => { | ||
const client = Cognito(); | ||
|
||
await client | ||
.adminCreateUser({ | ||
UserAttributes: [ | ||
{ Name: "email", Value: "[email protected]" }, | ||
{ Name: "custom:example", Value: "1" }, | ||
], | ||
Username: "abc", | ||
UserPoolId: "test", | ||
DesiredDeliveryMediums: ["EMAIL"], | ||
}); | ||
|
||
await client | ||
.adminDisableUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
let user = await client | ||
.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
await client.adminCreateUser({ | ||
UserAttributes: [ | ||
{ Name: "email", Value: "[email protected]" }, | ||
{ Name: "custom:example", Value: "1" }, | ||
], | ||
Username: "abc", | ||
UserPoolId: "test", | ||
DesiredDeliveryMediums: ["EMAIL"], | ||
}); | ||
|
||
await client.adminDisableUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
let user = await client.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
expect(user.Enabled).toEqual(false); | ||
|
||
await client | ||
.adminEnableUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
await client.adminEnableUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
user = await client | ||
.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
user = await client.adminGetUser({ | ||
UserPoolId: "test", | ||
Username: "abc", | ||
}); | ||
|
||
expect(user.Enabled).toEqual(true); | ||
}); | ||
}) | ||
}), | ||
); |
Oops, something went wrong.