Fix broken tests

This commit is contained in:
Adria Navarro 2023-01-20 10:29:11 +00:00
parent 12118fd028
commit 62b372ce59
2 changed files with 16 additions and 14 deletions

View File

@ -558,13 +558,11 @@ class TestConfiguration {
// DATASOURCE
async createDatasource(config?: Datasource): Promise<Datasource> {
async createDatasource(config?: {
datasource: Datasource
}): Promise<Datasource> {
config = config || basicDatasource()
const response = await this._req(
{ datasource: config },
null,
controllers.datasource.save
)
const response = await this._req(config, null, controllers.datasource.save)
this.datasource = response.datasource
return this.datasource
}
@ -581,9 +579,11 @@ class TestConfiguration {
async restDatasource(cfg?: any) {
return this.createDatasource({
...basicDatasource(),
datasource: {
...basicDatasource().datasource,
source: SourceName.REST,
config: cfg || {},
},
})
}

View File

@ -145,12 +145,14 @@ export function basicRole() {
}
}
export function basicDatasource(): Datasource {
export function basicDatasource(): { datasource: Datasource } {
return {
datasource: {
type: "datasource",
name: "Test",
source: SourceName.POSTGRES,
config: {},
},
}
}