wip league admin tools
This commit is contained in:
@@ -20,7 +20,7 @@ describe('Race', () => {
|
||||
expect(race.track).toBe('Monza');
|
||||
expect(race.car).toBe('Ferrari SF21');
|
||||
expect(race.sessionType).toEqual(SessionType.main());
|
||||
expect(race.status).toBe('scheduled');
|
||||
expect(race.status.toString()).toBe('scheduled');
|
||||
expect(race.trackId).toBeUndefined();
|
||||
expect(race.carId).toBeUndefined();
|
||||
expect(race.strengthOfField).toBeUndefined();
|
||||
@@ -53,10 +53,10 @@ describe('Race', () => {
|
||||
expect(race.car).toBe('Ferrari SF21');
|
||||
expect(race.carId).toBe('car-1');
|
||||
expect(race.sessionType).toEqual(SessionType.qualifying());
|
||||
expect(race.status).toBe('running');
|
||||
expect(race.strengthOfField).toBe(1500);
|
||||
expect(race.registeredCount).toBe(20);
|
||||
expect(race.maxParticipants).toBe(24);
|
||||
expect(race.status.toString()).toBe('running');
|
||||
expect(race.strengthOfField?.toNumber()).toBe(1500);
|
||||
expect(race.registeredCount?.toNumber()).toBe(20);
|
||||
expect(race.maxParticipants?.toNumber()).toBe(24);
|
||||
});
|
||||
|
||||
it('should throw error for invalid id', () => {
|
||||
@@ -126,7 +126,7 @@ describe('Race', () => {
|
||||
status: 'scheduled',
|
||||
});
|
||||
const started = race.start();
|
||||
expect(started.status).toBe('running');
|
||||
expect(started.status.toString()).toBe('running');
|
||||
});
|
||||
|
||||
it('should throw error if not scheduled', () => {
|
||||
@@ -155,7 +155,7 @@ describe('Race', () => {
|
||||
status: 'running',
|
||||
});
|
||||
const completed = race.complete();
|
||||
expect(completed.status).toBe('completed');
|
||||
expect(completed.status.toString()).toBe('completed');
|
||||
});
|
||||
|
||||
it('should throw error if already completed', () => {
|
||||
@@ -197,7 +197,7 @@ describe('Race', () => {
|
||||
status: 'scheduled',
|
||||
});
|
||||
const cancelled = race.cancel();
|
||||
expect(cancelled.status).toBe('cancelled');
|
||||
expect(cancelled.status.toString()).toBe('cancelled');
|
||||
});
|
||||
|
||||
it('should throw error if completed', () => {
|
||||
@@ -238,8 +238,8 @@ describe('Race', () => {
|
||||
car: 'Ferrari SF21',
|
||||
});
|
||||
const updated = race.updateField(1600, 22);
|
||||
expect(updated.strengthOfField).toBe(1600);
|
||||
expect(updated.registeredCount).toBe(22);
|
||||
expect(updated.strengthOfField?.toNumber()).toBe(1600);
|
||||
expect(updated.registeredCount?.toNumber()).toBe(22);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user