36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
||
import type { StepHarness } from '../support/StepHarness';
|
||
import { createStepHarness } from '../support/StepHarness';
|
||
|
||
describe('Step 7 – time limits', () => {
|
||
let harness: StepHarness;
|
||
|
||
beforeEach(async () => {
|
||
harness = await createStepHarness();
|
||
});
|
||
|
||
afterEach(async () => {
|
||
await harness.dispose();
|
||
});
|
||
|
||
it('executes on Time Limits page and navigates to Cars', async () => {
|
||
await harness.navigateToFixtureStep(7);
|
||
const page = harness.adapter.getPage();
|
||
expect(page).not.toBeNull();
|
||
|
||
const stepIndicatorBefore = await page!.textContent('[data-indicator]');
|
||
expect(stepIndicatorBefore).toContain('Time Limits');
|
||
|
||
const result = await harness.executeStep(7, {
|
||
practice: 10,
|
||
qualify: 10,
|
||
race: 20,
|
||
});
|
||
|
||
expect(result.success).toBe(true);
|
||
expect(result.error).toBeUndefined();
|
||
|
||
const stepIndicatorAfter = await page!.textContent('[data-indicator]');
|
||
expect(stepIndicatorAfter).toContain('Set Cars');
|
||
});
|
||
}); |