Add comments
This commit is contained in:
parent
464a10f641
commit
1fc46002e2
|
@ -59,11 +59,7 @@ class PublicAPIClient {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const response = await fetch(`https://${process.env.TENANT_ID}.${this.host}${url}`, requestOptions)
|
const response = await fetch(`https://${process.env.TENANT_ID}.${this.host}${url}`, requestOptions)
|
||||||
|
|
||||||
if (
|
if (response.status == 500 || response.status == 403) {
|
||||||
response.status == 404 ||
|
|
||||||
response.status == 500 ||
|
|
||||||
response.status == 403
|
|
||||||
) {
|
|
||||||
console.error("Error in apiCall")
|
console.error("Error in apiCall")
|
||||||
console.error("Response:", response)
|
console.error("Response:", response)
|
||||||
const json = await response.json()
|
const json = await response.json()
|
||||||
|
|
|
@ -47,6 +47,8 @@ export default class TestConfiguration<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async setupAccountAndTenant() {
|
async setupAccountAndTenant() {
|
||||||
|
// This step is required to create a new account and tenant for the tests, its part of
|
||||||
|
// the support for running tests in multiple environments.
|
||||||
const account = generateAccount()
|
const account = generateAccount()
|
||||||
await this.accounts.validateEmail(<string>account.email)
|
await this.accounts.validateEmail(<string>account.email)
|
||||||
await this.accounts.validateTenantId(<string>account.tenantId)
|
await this.accounts.validateTenantId(<string>account.tenantId)
|
||||||
|
@ -63,6 +65,7 @@ export default class TestConfiguration<T> {
|
||||||
await this.internalApplicationsApi.create(body)
|
await this.internalApplicationsApi.create(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// After the account and tenant have been created, we need to get and set the API key for the test
|
||||||
async setApiKey() {
|
async setApiKey() {
|
||||||
const apiKeyResponse = await this.auth.getApiKey()
|
const apiKeyResponse = await this.auth.getApiKey()
|
||||||
this.apiClient.setApiKey(apiKeyResponse.apiKey)
|
this.apiClient.setApiKey(apiKeyResponse.apiKey)
|
||||||
|
|
Loading…
Reference in New Issue