resolve todos in website
This commit is contained in:
@@ -252,6 +252,36 @@ describe('RaceDetailViewModel', () => {
|
||||
expect(viewModel.registrationStatusMessage).toBe('Registration not available');
|
||||
});
|
||||
|
||||
it('should expose canReopenRace for completed and cancelled statuses', () => {
|
||||
const completedVm = new RaceDetailViewModel({
|
||||
race: createMockRace({ status: 'completed' }),
|
||||
league: createMockLeague(),
|
||||
entryList: [],
|
||||
registration: createMockRegistration(),
|
||||
userResult: null,
|
||||
});
|
||||
|
||||
const cancelledVm = new RaceDetailViewModel({
|
||||
race: createMockRace({ status: 'cancelled' as any }),
|
||||
league: createMockLeague(),
|
||||
entryList: [],
|
||||
registration: createMockRegistration(),
|
||||
userResult: null,
|
||||
});
|
||||
|
||||
const upcomingVm = new RaceDetailViewModel({
|
||||
race: createMockRace({ status: 'upcoming' }),
|
||||
league: createMockLeague(),
|
||||
entryList: [],
|
||||
registration: createMockRegistration(),
|
||||
userResult: null,
|
||||
});
|
||||
|
||||
expect(completedVm.canReopenRace).toBe(true);
|
||||
expect(cancelledVm.canReopenRace).toBe(true);
|
||||
expect(upcomingVm.canReopenRace).toBe(false);
|
||||
});
|
||||
|
||||
it('should handle error property', () => {
|
||||
const viewModel = new RaceDetailViewModel({
|
||||
race: createMockRace(),
|
||||
|
||||
Reference in New Issue
Block a user