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