Add extra tests

This commit is contained in:
Adria Navarro 2024-07-11 17:14:14 +02:00
parent d03a0ebb68
commit 9ff3d8cf77
1 changed files with 26 additions and 0 deletions

View File

@ -224,5 +224,31 @@ describe("/rowsActions", () => {
})
)
})
it("throws Bad Request when trying to update by a non-existing id", async () => {
await createRowAction(tableId, createRowActionRequest())
await config.api.rowAction.update(
tableId,
generator.guid(),
createRowActionRequest(),
{ status: 400 }
)
})
it("throws Bad Request when trying to update by a via another table id", async () => {
const otherTable = await config.api.table.save(
setup.structures.basicTable()
)
await createRowAction(otherTable._id!, createRowActionRequest())
const action = await createRowAction(tableId, createRowActionRequest())
await config.api.rowAction.update(
otherTable._id!,
action.actionId,
createRowActionRequest(),
{ status: 400 }
)
})
})
})