Fixing test cases.

This commit is contained in:
mike12345567 2021-10-27 13:10:46 +01:00
parent eb411cd0b0
commit fa38a4b37e
3 changed files with 4 additions and 4 deletions

View File

@ -26,8 +26,8 @@ describe("/datasources", () => {
.expect('Content-Type', /json/)
.expect(200)
expect(res.res.statusMessage).toEqual("Datasource saved successfully.")
expect(res.body.name).toEqual("Test")
expect(res.body.datasource.name).toEqual("Test")
expect(res.body.errors).toBeUndefined()
})
})

View File

@ -1,7 +1,6 @@
// mock out postgres for this
jest.mock("pg")
const { findLastKey } = require("lodash/fp")
const setup = require("./utilities")
const { checkBuilderEndpoint } = require("./utilities/TestFunctions")
const { basicQuery, basicDatasource } = setup.structures

View File

@ -283,7 +283,8 @@ class TestConfiguration {
async createDatasource(config = null) {
config = config || basicDatasource()
this.datasource = await this._req(config, null, controllers.datasource.save)
const response = await this._req(config, null, controllers.datasource.save)
this.datasource = response.datasource
return this.datasource
}