Fix tests typing

This commit is contained in:
Adria Navarro 2023-12-04 09:23:01 +01:00
parent 188d5d09a2
commit 083ff0b7c7
1 changed files with 7 additions and 3 deletions

View File

@ -137,6 +137,10 @@ class TestConfiguration {
}
getAppId() {
if (!this.appId) {
throw "appId has not been initialised properly"
}
return this.appId
}
@ -510,7 +514,7 @@ class TestConfiguration {
// create dev app
// clear any old app
this.appId = null
this.app = await context.doInAppContext(null, async () => {
this.app = await context.doInTenant(this.tenantId!, async () => {
const app = await this._req(
{ name: appName },
null,
@ -519,7 +523,7 @@ class TestConfiguration {
this.appId = app.appId!
return app
})
return await context.doInAppContext(this.appId, async () => {
return await context.doInAppContext(this.getAppId(), async () => {
// create production app
this.prodApp = await this.publish()
@ -817,7 +821,7 @@ class TestConfiguration {
}
async getAutomationLogs() {
return context.doInAppContext(this.appId, async () => {
return context.doInAppContext(this.getAppId(), async () => {
const now = new Date()
return await pro.sdk.automations.logs.logSearch({
startDate: new Date(now.getTime() - 100000).toISOString(),