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: {
|
||||||
source: SourceName.REST,
|
...basicDatasource().datasource,
|
||||||
config: cfg || {},
|
source: SourceName.REST,
|
||||||
|
config: cfg || {},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,12 +145,14 @@ export function basicRole() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function basicDatasource(): Datasource {
|
export function basicDatasource(): { datasource: Datasource } {
|
||||||
return {
|
return {
|
||||||
type: "datasource",
|
datasource: {
|
||||||
name: "Test",
|
type: "datasource",
|
||||||
source: SourceName.POSTGRES,
|
name: "Test",
|
||||||
config: {},
|
source: SourceName.POSTGRES,
|
||||||
|
config: {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue