1
0
Fork 0
mirror of synced 2024-07-03 21:40:55 +12:00

Add comments

This commit is contained in:
Pedro Silva 2023-03-13 18:05:46 +00:00
parent 464a10f641
commit 1fc46002e2
2 changed files with 4 additions and 5 deletions

View file

@ -59,11 +59,7 @@ class PublicAPIClient {
// @ts-ignore
const response = await fetch(`https://${process.env.TENANT_ID}.${this.host}${url}`, requestOptions)
if (
response.status == 404 ||
response.status == 500 ||
response.status == 403
) {
if (response.status == 500 || response.status == 403) {
console.error("Error in apiCall")
console.error("Response:", response)
const json = await response.json()

View file

@ -47,6 +47,8 @@ export default class TestConfiguration<T> {
}
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()
await this.accounts.validateEmail(<string>account.email)
await this.accounts.validateTenantId(<string>account.tenantId)
@ -63,6 +65,7 @@ export default class TestConfiguration<T> {
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() {
const apiKeyResponse = await this.auth.getApiKey()
this.apiClient.setApiKey(apiKeyResponse.apiKey)