From 4187310ae1f197670f451ebf73f540b06df2cd8a Mon Sep 17 00:00:00 2001 From: Uwe Ilgenstein Date: Wed, 12 Jun 2024 10:19:58 +0200 Subject: [PATCH] add unit test --- .../entity/column-board-node.entity.spec.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 apps/server/src/shared/domain/entity/column-board-node.entity.spec.ts diff --git a/apps/server/src/shared/domain/entity/column-board-node.entity.spec.ts b/apps/server/src/shared/domain/entity/column-board-node.entity.spec.ts new file mode 100644 index 00000000000..b632cdbf500 --- /dev/null +++ b/apps/server/src/shared/domain/entity/column-board-node.entity.spec.ts @@ -0,0 +1,20 @@ +import { columnBoardNodeFactory } from '@shared/testing'; +import { ColumnBoardNode } from './column-board-node.entity'; + +describe(ColumnBoardNode.name, () => { + it('should be able to be published', () => { + const nodeEntity = columnBoardNodeFactory.build({ isVisible: false }); + + nodeEntity.publish(); + + expect(nodeEntity.isVisible).toBe(true); + }); + + it('should be able to be unpublished', () => { + const nodeEntity = columnBoardNodeFactory.build({ isVisible: true }); + + nodeEntity.unpublish(); + + expect(nodeEntity.isVisible).toBe(false); + }); +});