diff --git a/apps/server/src/modules/demo/loggable/demo-school-create.loggable.spec.ts b/apps/server/src/modules/demo/loggable/demo-school-create.loggable.spec.ts new file mode 100644 index 00000000000..9f3b1aa9d40 --- /dev/null +++ b/apps/server/src/modules/demo/loggable/demo-school-create.loggable.spec.ts @@ -0,0 +1,28 @@ +import { CrudOperation } from '@shared/types'; +import { DemoSchoolCreateLoggable } from './demo-school-create.loggable'; + +describe(DemoSchoolCreateLoggable.name, () => { + describe('getLogMessage', () => { + const setup = () => { + const userId = 'fakeId'; + + const loggable = new DemoSchoolCreateLoggable(userId); + + return { userId, loggable }; + }; + + it('should log the correct message', () => { + const { loggable, userId } = setup(); + + const result = loggable.getLogMessage(); + + expect(result).toEqual({ + message: expect.any(String), + data: { + operation: CrudOperation.CREATE, + userId, + }, + }); + }); + }); +});