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

View File

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