Skip to content

Commit

Permalink
Merge branch 'BC-6871-board-refactor' of github.com:hpi-schul-cloud/s…
Browse files Browse the repository at this point in the history
…chulcloud-server into BC-6871-board-refactor
  • Loading branch information
uidp committed Jun 13, 2024
2 parents ac15874 + 099e276 commit ceb877c
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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({
Expand Down

0 comments on commit ceb877c

Please sign in to comment.