Some fixes based on test runs.
This commit is contained in:
parent
4fd408defc
commit
37410e041a
|
@ -1,4 +1,12 @@
|
|||
jest.mock("../../../utilities/fileSystem/utilities")
|
||||
jest.mock("@budibase/backend-core", () => {
|
||||
const core = jest.requireActual("@budibase/backend-core")
|
||||
return {
|
||||
...core,
|
||||
objectStore: {
|
||||
budibaseTempDir: core.objectStore.budibaseTempDir,
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
const { checkBuilderEndpoint } = require("./utilities/TestFunctions")
|
||||
const setup = require("./utilities")
|
||||
|
|
|
@ -154,7 +154,7 @@ describe("Authorization middleware", () => {
|
|||
_id: ""
|
||||
},
|
||||
})
|
||||
config.setMiddlewareRequiredPermission(PermissionType.ADMIN, PermissionLevel.BASIC)
|
||||
config.setMiddlewareRequiredPermission(permissions.PermissionType.ADMIN, permissions.PermissionLevel.BASIC)
|
||||
|
||||
await config.executeMiddleware()
|
||||
expect(config.throw).toHaveBeenCalledWith(403, "User does not have permission")
|
||||
|
|
|
@ -52,7 +52,7 @@ export function processAutoColumn(
|
|||
user: User | null,
|
||||
table: Table,
|
||||
row: Row,
|
||||
opts: AutoColumnProcessingOpts
|
||||
opts?: AutoColumnProcessingOpts
|
||||
) {
|
||||
let noUser = !user || !user.userId
|
||||
let isUserTable = table._id === InternalTables.USER_METADATA
|
||||
|
@ -61,7 +61,7 @@ export function processAutoColumn(
|
|||
const creating = !row._rev
|
||||
// check its not user table, or whether any of the processing options have been disabled
|
||||
const shouldUpdateUserFields =
|
||||
!isUserTable && !opts.reprocessing && !opts.noAutoRelationships && !noUser
|
||||
!isUserTable && !opts?.reprocessing && !opts?.noAutoRelationships && !noUser
|
||||
for (let [key, schema] of Object.entries(table.schema)) {
|
||||
if (!schema.autocolumn) {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue