Skip to content

Commit

Permalink
chore: add test for loggable
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeppner-dataport committed Sep 26, 2023
1 parent 7926d01 commit ae51bf8
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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,
},
});
});
});
});

0 comments on commit ae51bf8

Please sign in to comment.