This commit is contained in:
2025-12-16 21:05:01 +01:00
parent f61e3a4e5a
commit 7532c7ed6d
207 changed files with 7861 additions and 2606 deletions

View File

@@ -68,7 +68,7 @@ describe('ApplyPenaltyUseCase', () => {
});
expect(result.isOk()).toBe(false);
expect(result.error!.message).toBe('Race not found');
expect(result.error!.code).toBe('RACE_NOT_FOUND');
});
it('should return error when steward does not have authority', async () => {
@@ -95,7 +95,7 @@ describe('ApplyPenaltyUseCase', () => {
});
expect(result.isOk()).toBe(false);
expect(result.error!.message).toBe('Only league owners and admins can apply penalties');
expect(result.error!.code).toBe('INSUFFICIENT_AUTHORITY');
});
it('should return error when protest does not exist', async () => {
@@ -124,7 +124,7 @@ describe('ApplyPenaltyUseCase', () => {
});
expect(result.isOk()).toBe(false);
expect(result.error!.message).toBe('Protest not found');
expect(result.error!.code).toBe('PROTEST_NOT_FOUND');
});
it('should return error when protest is not upheld', async () => {
@@ -153,7 +153,7 @@ describe('ApplyPenaltyUseCase', () => {
});
expect(result.isOk()).toBe(false);
expect(result.error!.message).toBe('Can only create penalties for upheld protests');
expect(result.error!.code).toBe('PROTEST_NOT_UPHELD');
});
it('should return error when protest is not for this race', async () => {
@@ -182,7 +182,7 @@ describe('ApplyPenaltyUseCase', () => {
});
expect(result.isOk()).toBe(false);
expect(result.error!.message).toBe('Protest is not for this race');
expect(result.error!.code).toBe('PROTEST_NOT_FOR_RACE');
});
it('should create penalty and return result on success', async () => {