diff --git a/apps/server/src/modules/board/service/internal/board-context.service.spec.ts b/apps/server/src/modules/board/service/internal/board-context.service.spec.ts index 9f7d4717a1c..46e09f3598e 100644 --- a/apps/server/src/modules/board/service/internal/board-context.service.spec.ts +++ b/apps/server/src/modules/board/service/internal/board-context.service.spec.ts @@ -45,7 +45,7 @@ describe(`${BoardContextService.name}`, () => { return { column }; }; - it('should throw an error', async () => { + it('should return empty array', async () => { const { column } = setup(); const result = await service.getUsersWithBoardRoles(column); @@ -54,6 +54,22 @@ describe(`${BoardContextService.name}`, () => { }); }); + describe('when node has wrong context type', () => { + const setup = () => { + const columnBoard = columnBoardFactory.build({ + context: { id: new ObjectId().toHexString(), type: 'foo' as BoardExternalReferenceType }, + }); + + return { columnBoard }; + }; + + it('should throw an error', async () => { + const { columnBoard } = setup(); + + await expect(service.getUsersWithBoardRoles(columnBoard)).rejects.toThrowError(); + }); + }); + describe('when node has a user context', () => { const setup = () => { const columnBoard = columnBoardFactory.build({