Fix tests

This commit is contained in:
adrinr 2023-03-28 13:56:54 +01:00
parent ac1da306f9
commit 31f94f6c3c
2 changed files with 10 additions and 10 deletions

View File

@ -10,12 +10,12 @@ import {
GroupAddedOnboardingEvent, GroupAddedOnboardingEvent,
GroupPermissionsEditedEvent, GroupPermissionsEditedEvent,
} from "@budibase/types" } from "@budibase/types"
import { context } from "../.." import { isScim } from "../../context"
async function created(group: UserGroup, timestamp?: number) { async function created(group: UserGroup, timestamp?: number) {
const properties: GroupCreatedEvent = { const properties: GroupCreatedEvent = {
groupId: group._id as string, groupId: group._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
name: group.name, name: group.name,
}, },
@ -26,7 +26,7 @@ async function created(group: UserGroup, timestamp?: number) {
async function updated(group: UserGroup) { async function updated(group: UserGroup) {
const properties: GroupUpdatedEvent = { const properties: GroupUpdatedEvent = {
groupId: group._id as string, groupId: group._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
name: group.name, name: group.name,
}, },
@ -37,7 +37,7 @@ async function updated(group: UserGroup) {
async function deleted(group: UserGroup) { async function deleted(group: UserGroup) {
const properties: GroupDeletedEvent = { const properties: GroupDeletedEvent = {
groupId: group._id as string, groupId: group._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
name: group.name, name: group.name,
}, },
@ -49,7 +49,7 @@ async function usersAdded(count: number, group: UserGroup) {
const properties: GroupUsersAddedEvent = { const properties: GroupUsersAddedEvent = {
count, count,
groupId: group._id as string, groupId: group._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
name: group.name, name: group.name,
}, },
@ -61,7 +61,7 @@ async function usersDeleted(count: number, group: UserGroup) {
const properties: GroupUsersDeletedEvent = { const properties: GroupUsersDeletedEvent = {
count, count,
groupId: group._id as string, groupId: group._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
name: group.name, name: group.name,
}, },

View File

@ -15,12 +15,12 @@ import {
UserUpdatedEvent, UserUpdatedEvent,
UserOnboardingEvent, UserOnboardingEvent,
} from "@budibase/types" } from "@budibase/types"
import { context } from "../.." import { isScim } from "../../context"
async function created(user: User, timestamp?: number) { async function created(user: User, timestamp?: number) {
const properties: UserCreatedEvent = { const properties: UserCreatedEvent = {
userId: user._id as string, userId: user._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
email: user.email, email: user.email,
}, },
@ -31,7 +31,7 @@ async function created(user: User, timestamp?: number) {
async function updated(user: User) { async function updated(user: User) {
const properties: UserUpdatedEvent = { const properties: UserUpdatedEvent = {
userId: user._id as string, userId: user._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
email: user.email, email: user.email,
}, },
@ -42,7 +42,7 @@ async function updated(user: User) {
async function deleted(user: User) { async function deleted(user: User) {
const properties: UserDeletedEvent = { const properties: UserDeletedEvent = {
userId: user._id as string, userId: user._id as string,
viaScim: context.isScim(), viaScim: isScim(),
audited: { audited: {
email: user.email, email: user.email,
}, },