Skip to content

Commit

Permalink
SPSH-696: Fixed coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
phaelcg committed Jul 16, 2024
1 parent ba96bae commit a636469
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/modules/rolle/repo/rolle.repo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ describe('RolleRepo', () => {
DoFactory.createRolle(false, { administeredBySchulstrukturknoten: faker.string.uuid() }),
);
const permissions: DeepMocked<PersonPermissions> = createMock<PersonPermissions>();

permissions.getOrgIdsWithSystemrecht.mockResolvedValueOnce([]);

const rolleResult: Rolle<true> | DomainError = await sut.updateRolle(
Expand All @@ -302,5 +301,25 @@ describe('RolleRepo', () => {

expect(rolleResult).toBeInstanceOf(DomainError);
});

it('should return error when service providers doe not exist', async () => {
const organisationId: OrganisationID = faker.string.uuid();
const rolle: Rolle<true> = await sut.save(
DoFactory.createRolle(false, { administeredBySchulstrukturknoten: organisationId }),
);
const permissions: DeepMocked<PersonPermissions> = createMock<PersonPermissions>();
permissions.getOrgIdsWithSystemrecht.mockResolvedValueOnce([organisationId]);

const rolleResult: Rolle<true> | DomainError = await sut.updateRolle(
rolle.id,
faker.company.name(),
[],
[],
[faker.string.uuid()],
permissions,
);

expect(rolleResult).toBeInstanceOf(DomainError);
});
});
});

0 comments on commit a636469

Please sign in to comment.