1
0
Fork 0
mirror of synced 2024-09-17 09:49:11 +12:00

Merge branch 'develop' into feature/app-quotas

This commit is contained in:
Rory Powell 2022-09-28 12:33:39 +01:00
commit 98168aee29
2 changed files with 20 additions and 20 deletions

View file

@ -68,7 +68,7 @@ export function getQueryIndex(viewName: ViewName) {
* Check if a given ID is that of a table. * Check if a given ID is that of a table.
* @returns {boolean} * @returns {boolean}
*/ */
exports.isTableId = (id: string) => { export const isTableId = (id: string) => {
// this includes datasource plus tables // this includes datasource plus tables
return ( return (
id && id &&
@ -81,7 +81,7 @@ exports.isTableId = (id: string) => {
* Check if a given ID is that of a datasource or datasource plus. * Check if a given ID is that of a datasource or datasource plus.
* @returns {boolean} * @returns {boolean}
*/ */
exports.isDatasourceId = (id: string) => { export const isDatasourceId = (id: string) => {
// this covers both datasources and datasource plus // this covers both datasources and datasource plus
return id && id.startsWith(`${DocumentType.DATASOURCE}${SEPARATOR}`) return id && id.startsWith(`${DocumentType.DATASOURCE}${SEPARATOR}`)
} }

View file

@ -55,26 +55,26 @@ describe("/rows", () => {
describe("save, load, update", () => { describe("save, load, update", () => {
it("returns a success message when the row is created", async () => { it("returns a success message when the row is created", async () => {
// const rowUsage = await getRowUsage() const rowUsage = await getRowUsage()
// const queryUsage = await getQueryUsage() const queryUsage = await getQueryUsage()
//
// const res = await request const res = await request
// .post(`/api/${row.tableId}/rows`) .post(`/api/${row.tableId}/rows`)
// .send(row) .send(row)
// .set(config.defaultHeaders()) .set(config.defaultHeaders())
// .expect('Content-Type', /json/) .expect('Content-Type', /json/)
// .expect(200) .expect(200)
// expect(res.res.statusMessage).toEqual(`${table.name} saved successfully`) expect(res.res.statusMessage).toEqual(`${table.name} saved successfully`)
// expect(res.body.name).toEqual("Test Contact") expect(res.body.name).toEqual("Test Contact")
// expect(res.body._rev).toBeDefined() expect(res.body._rev).toBeDefined()
// await assertRowUsage(rowUsage + 1) await assertRowUsage(rowUsage + 1)
// await assertQueryUsage(queryUsage + 1) await assertQueryUsage(queryUsage + 1)
}) })
it("updates a row successfully", async () => { it("updates a row successfully", async () => {
const existing = await config.createRow() const existing = await config.createRow()
// const rowUsage = await getRowUsage() const rowUsage = await getRowUsage()
// const queryUsage = await getQueryUsage() const queryUsage = await getQueryUsage()
const res = await request const res = await request
.post(`/api/${table._id}/rows`) .post(`/api/${table._id}/rows`)
@ -92,8 +92,8 @@ describe("/rows", () => {
`${table.name} updated successfully.` `${table.name} updated successfully.`
) )
expect(res.body.name).toEqual("Updated Name") expect(res.body.name).toEqual("Updated Name")
// await assertRowUsage(rowUsage) await assertRowUsage(rowUsage)
// await assertQueryUsage(queryUsage + 1) await assertQueryUsage(queryUsage + 1)
}) })
it("should load a row", async () => { it("should load a row", async () => {