-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
8d6a494
commit 2ccf9c6
Showing
3 changed files
with
7 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,9 @@ const TOKEN_RESPONSE: TokenResponse = { | |
|
||
const USER_INFO_RESPONSE: UserInfoResponse = { | ||
sub: '07ad51f5-d89b-4936-9b8a-c9b24f7430be', | ||
username: '07ad51f5-d89b-4936-9b8a-c9b24f7430be', | ||
email: '[email protected]', | ||
email_verified: 'true', | ||
'custom:quicksight_username': 'test-user', | ||
username: 'test-user', | ||
}; | ||
|
||
const EMBED_URL = 'https://eu-west-2.quicksight.aws.amazon.com/embedding/.../start?code=...'; | ||
|
@@ -81,7 +80,7 @@ test('success', async () => { | |
return { ok: true, json: async () => USER_INFO_RESPONSE }; | ||
}); | ||
|
||
const expectedArn = `arn:aws:quicksight:${process.env.AWS_REGION}:${ACCOUNT_ID}:user/default/${USER_INFO_RESPONSE['custom:quicksight_username']}`; | ||
const expectedArn = `arn:aws:quicksight:${process.env.AWS_REGION}:${ACCOUNT_ID}:user/default/${USER_INFO_RESPONSE.username}`; | ||
|
||
mockQuicksightClient | ||
.rejects() | ||
|
@@ -177,7 +176,7 @@ test('quicksight error', async () => { | |
.mockResolvedValueOnce({ ok: true, json: async () => TOKEN_RESPONSE }) | ||
.mockResolvedValueOnce({ ok: true, json: async () => USER_INFO_RESPONSE }); | ||
|
||
const expectedArn = `arn:aws:quicksight:${process.env.AWS_REGION}:${ACCOUNT_ID}:user/default/${USER_INFO_RESPONSE['custom:quicksight_username']}`; | ||
const expectedArn = `arn:aws:quicksight:${process.env.AWS_REGION}:${ACCOUNT_ID}:user/default/${USER_INFO_RESPONSE.username}`; | ||
|
||
const errorMessage = 'Quicksight error'; | ||
mockQuicksightClient.rejects(errorMessage); | ||
|
@@ -200,7 +199,7 @@ test('undefined embed url', async () => { | |
.mockResolvedValueOnce({ ok: true, json: async () => TOKEN_RESPONSE }) | ||
.mockResolvedValueOnce({ ok: true, json: async () => USER_INFO_RESPONSE }); | ||
|
||
const expectedArn = `arn:aws:quicksight:${process.env.AWS_REGION}:${ACCOUNT_ID}:user/default/${USER_INFO_RESPONSE['custom:quicksight_username']}`; | ||
const expectedArn = `arn:aws:quicksight:${process.env.AWS_REGION}:${ACCOUNT_ID}:user/default/${USER_INFO_RESPONSE.username}`; | ||
|
||
mockQuicksightClient.resolves({ EmbedUrl: undefined }); | ||
|
||
|
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