refactor
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user