Add firstApp creation to public api tests
This commit is contained in:
parent
6a3fa60078
commit
dfff64b847
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue