-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: use test replaceable port * fix: pr reviews * fix: unit test * fix: ui test * fix: writeFile * fix: ppr reviews * fix: remove port check * Revert "fix: remove port check" This reverts commit d7a2022. * fix: mock port variable * Revert "fix: mock port variable" This reverts commit 017ac27. * fix: pr reviews
- Loading branch information
Showing
16 changed files
with
51 additions
and
46 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
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 |
---|---|---|
|
@@ -80,7 +80,7 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H | |
'/api/v1/message/FES-MOCK-EXTERNAL-ID/gateway': async ({ body }, req) => { | ||
const port = parsePort(req); | ||
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal` | ||
authenticate(req, isCustomIDPUsed); | ||
expect(body).to.match(messageIdRegex(port)); | ||
return {}; | ||
|
@@ -90,7 +90,7 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H | |
'/api/v1/message/[email protected]/gateway': async ({ body }, req) => { | ||
const port = parsePort(req); | ||
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering` | ||
// test: `compose - [email protected] - PWD encrypted message with FES - Reply rendering` | ||
authenticate(req, isCustomIDPUsed); | ||
expect(body).to.match(messageIdRegex(port)); | ||
return {}; | ||
|
@@ -100,10 +100,10 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H | |
'/api/v1/message/[email protected]/gateway': async ({ body }, req) => { | ||
const port = parsePort(req); | ||
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering` | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - pubkey recipient in bcc` | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - some sends fail with BadRequest error` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected] - PWD encrypted message with FES - Reply rendering` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal - pubkey recipient in bcc` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal - some sends fail with BadRequest error` | ||
authenticate(req, isCustomIDPUsed); | ||
expect(body).to.match(messageIdRegex(port)); | ||
return {}; | ||
|
@@ -113,15 +113,15 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H | |
'/api/v1/message/[email protected]/gateway': async ({ body }, req) => { | ||
const port = parsePort(req); | ||
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal` | ||
authenticate(req, isCustomIDPUsed); | ||
expect(body).to.match(messageIdRegex(port)); | ||
return {}; | ||
} | ||
throw new HttpClientErr('Not Found', 404); | ||
}, | ||
'/api/v1/message/[email protected]/gateway': async () => { | ||
// test: `[email protected]:8001 - PWD encrypted message with FES web portal - a send fails with gateway update error` | ||
// test: `[email protected] - PWD encrypted message with FES web portal - a send fails with gateway update error` | ||
throw new HttpClientErr(`Test error`, Status.BAD_REQUEST); | ||
}, | ||
}; | ||
|
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 |
---|---|---|
|
@@ -159,7 +159,7 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined): | |
}, | ||
'/shared-tenant-fes/api/v1/message/FES-MOCK-EXTERNAL-ID/gateway': async ({ body }, req) => { | ||
if (req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal` | ||
authenticate(req, 'oidc'); | ||
expect(body).to.match(messageIdRegexForRequest(req)); | ||
return {}; | ||
|
@@ -168,7 +168,7 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined): | |
}, | ||
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async ({ body }, req) => { | ||
if (req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering` | ||
// test: `compose - [email protected] - PWD encrypted message with FES - Reply rendering` | ||
authenticate(req, 'oidc'); | ||
expect(body).to.match(messageIdRegexForRequest(req)); | ||
return {}; | ||
|
@@ -177,10 +177,10 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined): | |
}, | ||
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async ({ body }, req) => { | ||
if (req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering` | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - pubkey recipient in bcc` | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - some sends fail with BadRequest error` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected] - PWD encrypted message with FES - Reply rendering` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal - pubkey recipient in bcc` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal - some sends fail with BadRequest error` | ||
authenticate(req, 'oidc'); | ||
expect(body).to.match(messageIdRegexForRequest(req)); | ||
return {}; | ||
|
@@ -189,15 +189,15 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined): | |
}, | ||
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async ({ body }, req) => { | ||
if (req.method === 'POST') { | ||
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal` | ||
// test: `compose - [email protected] - PWD encrypted message with FES web portal` | ||
authenticate(req, 'oidc'); | ||
expect(body).to.match(messageIdRegexForRequest(req)); | ||
return {}; | ||
} | ||
throw new HttpClientErr('Not Found', 404); | ||
}, | ||
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async () => { | ||
// test: `[email protected]:8001 - PWD encrypted message with FES web portal - a send fails with gateway update error` | ||
// test: `[email protected] - PWD encrypted message with FES web portal - a send fails with gateway update error` | ||
throw new HttpClientErr(`Test error`, Status.BAD_REQUEST); | ||
}, | ||
}; | ||
|
2 changes: 1 addition & 1 deletion
2
test/source/mock/google/exported-messages/message-export-1803be3182d1937b.json
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"acctEmail": "[email protected]:8001", | ||
"acctEmail": "[email protected]", | ||
"full": { | ||
"id": "1803be3182d1937b", | ||
"threadId": "1803be2e506153d2", | ||
|
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 |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - trailing slash`); | ||
(async () => { | ||
const email = '[email protected]'; | ||
const sks = new Sks('https://localhost:8001/'); | ||
const sks = new Sks(`https://localhost:${MOCK_PORT}/`); | ||
const { pubkey } = await sks.lookupEmail(email); | ||
const key = await KeyUtil.parse(pubkey); | ||
if (key.id !== '094C3CBA696FA009F6015C473B635D858A1DB5E0') { | ||
|
@@ -35,7 +35,7 @@ BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - trailing slash`); | |
BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - no trailing slash`); | ||
(async () => { | ||
const email = '[email protected]'; | ||
const sks = new Sks('https://localhost:8001'); | ||
const sks = new Sks(`https://localhost:${MOCK_PORT}`); | ||
const { pubkey } = await sks.lookupEmail(email); | ||
const key = await KeyUtil.parse(pubkey); | ||
if (key.id !== '094C3CBA696FA009F6015C473B635D858A1DB5E0') { | ||
|
@@ -62,7 +62,7 @@ BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - server down`); | |
BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - not found`); | ||
(async () => { | ||
const email = '[email protected]'; | ||
const sks = new Sks('https://localhost:8001/'); | ||
const sks = new Sks(`https://localhost:${MOCK_PORT}/`); | ||
const { pubkey } = await sks.lookupEmail(email); | ||
if (pubkey !== null) { | ||
throw Error(`expected pubkey=null but got ${pubkey}`); | ||
|
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 |
---|---|---|
|
@@ -3062,7 +3062,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te | |
); | ||
|
||
test( | ||
'[email protected]:8001 - PWD encrypted message with FES web portal', | ||
'[email protected] - PWD encrypted message with FES web portal', | ||
testWithBrowser(async (t, browser) => { | ||
const port = t.context.urls?.port; | ||
t.context.mockApi!.configProvider = new ConfigurationProvider({ | ||
|
@@ -3122,7 +3122,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te | |
); | ||
|
||
test( | ||
'[email protected]:8001 - PWD encrypted message with FES - Reply rendering', | ||
'[email protected] - PWD encrypted message with FES - Reply rendering', | ||
testWithBrowser(async (t, browser) => { | ||
t.context.mockApi!.configProvider = new ConfigurationProvider({ | ||
attester: { | ||
|
@@ -3218,7 +3218,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te | |
); | ||
|
||
test( | ||
'[email protected]:8001 - PWD encrypted message with FES web portal - pubkey recipient in bcc', | ||
'[email protected] - PWD encrypted message with FES web portal - pubkey recipient in bcc', | ||
testWithBrowser(async (t, browser) => { | ||
t.context.mockApi!.configProvider = new ConfigurationProvider({ | ||
attester: { | ||
|
@@ -3255,7 +3255,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te | |
); | ||
|
||
test( | ||
'[email protected]:8001 - PWD encrypted message with FES web portal - a send fails with gateway update error', | ||
'[email protected] - PWD encrypted message with FES web portal - a send fails with gateway update error', | ||
testWithBrowser(async (t, browser) => { | ||
t.context.mockApi!.configProvider = new ConfigurationProvider({ | ||
attester: { | ||
|
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 |
---|---|---|
|
@@ -272,7 +272,7 @@ export const defineFlakyTests = (testVariant: TestVariant, testWithBrowser: Test | |
); | ||
|
||
test( | ||
'[email protected]:8001 - PWD encrypted message with FES web portal - some sends fail with BadRequest error', | ||
'[email protected] - PWD encrypted message with FES web portal - some sends fail with BadRequest error', | ||
testWithBrowser( | ||
async (t, browser) => { | ||
t.context.mockApi!.configProvider = new ConfigurationProvider({ | ||
|
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 |
---|---|---|
|
@@ -2269,7 +2269,7 @@ AN8G3r5Htj8olot+jm9mIa5XLXWzMNUZgg== | |
); | ||
|
||
test( | ||
'[email protected]:8001 - uses FES on standard domain', | ||
'[email protected] - uses FES on standard domain', | ||
testWithBrowser(async (t, browser) => { | ||
t.context.mockApi!.configProvider = new ConfigurationProvider({ | ||
attester: { | ||
|
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
Oops, something went wrong.