Fix broken tests
This commit is contained in:
parent
12118fd028
commit
62b372ce59
|
@ -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 || {},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -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: {},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue