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

Add firstApp creation to public api tests

This commit is contained in:
Pedro Silva 2023-03-02 15:17:17 +00:00
parent 6a3fa60078
commit dfff64b847
4 changed files with 13 additions and 4 deletions

View file

@ -48,11 +48,8 @@ class AccountsAPIClient {
response.status == 400
) {
console.error("Error in apiCall")
console.error("Response:")
console.error(response)
console.error("Response body:")
console.error(response.body)
console.error("Request body:")
console.error(requestOptions.body)
}
return response

View file

@ -63,4 +63,15 @@ export default class AppApi {
const response = await this.api.post(`/applications/${id}/unpublish`)
return [response]
}
async createFirstApp() {
const body = {
name: "My first app",
url: "my-first-app",
useTemplate: false,
sampleData: true,
}
const response = await this.api.post("/applications", { body })
expect(response).toHaveStatusCode(200)
}
}

View file

@ -24,7 +24,7 @@ export default class AuthApi {
async login(email: String, password: String): Promise<[Response, any]> {
const response = await this.api.post(`/auth/login`, {
body: {
username: email,
email: email,
password: password,
},
})

View file

@ -43,6 +43,7 @@ export default class TestConfiguration<T> {
await this.accounts.create(account)
await this.updateApiClients(<string>account.tenantName)
await this.auth.login(<string>account.email, <string>account.password)
await this.applications.createFirstApp()
}
async setApiKey() {