1
0
Fork 0
mirror of synced 2024-06-22 04:10:54 +12:00

Fixing test cases.

This commit is contained in:
mike12345567 2021-05-19 11:27:19 +01:00
parent 48b7a31c2a
commit ed4455b450
2 changed files with 2 additions and 20 deletions

View file

@ -210,7 +210,7 @@ exports.create = async function (ctx) {
exports.update = async function (ctx) {
const url = await getAppUrlIfNotInUse(ctx)
const db = new CouchDB(ctx.params.appId)
const application = await db.get(ctx.params.appId)
const application = await db.get(DocumentTypes.APP_METADATA)
const data = ctx.request.body
const newData = { ...application, ...data, url }
@ -231,7 +231,7 @@ exports.update = async function (ctx) {
exports.delete = async function (ctx) {
const db = new CouchDB(ctx.params.appId)
const app = await db.get(ctx.params.appId)
const app = await db.get(DocumentTypes.APP_METADATA)
const result = await db.destroy()
/* istanbul ignore next */
if (!env.isTest()) {

View file

@ -304,24 +304,6 @@ describe("/rows", () => {
})
})
describe("search", () => {
it("should run a search on the table", async () => {
const res = await request
.post(`/api/${table._id}/rows/search`)
.send({
query: {
name: "Test",
},
pagination: { pageSize: 25 }
})
.set(config.defaultHeaders())
.expect('Content-Type', /json/)
.expect(200)
expect(res.body.rows.length).toEqual(1)
expect(res.body.bookmark).toBeDefined()
})
})
describe("fetchView", () => {
it("should be able to fetch tables contents via 'view'", async () => {
const row = await config.createRow()