Files
api/services/nginx/app/tests/Api/SelfserveFixtureApiTest.php
T
Jeppe Bundgaard 206b487fa2 Add new table and enhance studio layout logic
Introduce `department_selfserve_studio_layouts` table for department-specific layouts and implement advanced auto-layout functionality in the DepartmentSelfServeStudio module. Added custom node definitions, updated styling, and integrated new logics for sorting and visualizing nodes in the Vue Flow interface.
2026-04-28 14:21:31 +02:00

24 lines
1.1 KiB
PHP

<?php
usesApiSuite();
it('creates a comprehensive self-serve API scenario with demo relays', function (): void {
$scenario = api_fixtures()->createSelfServeScenario();
expect($scenario['relay_ids']['machine'])->toStartWith('demo-')
->and($scenario['relay_ids']['entry'])->toStartWith('demo-')
->and($scenario['lane']['relay_machine_id'])->toStartWith('demo-')
->and($scenario['session']['status'])->toBe('MACHINE_STARTED')
->and($scenario['session']['metadata_json']['relay_ids']['machine'])->toBe($scenario['relay_ids']['machine'])
->and($scenario['tasks'])->toHaveCount(2)
->and($scenario['events'])->toHaveCount(3);
$lane = api_fixtures()->fetchRowById('department_lanes', (int)$scenario['lane']['id']);
$session = api_fixtures()->fetchRowById('selfserve_wash_sessions', (int)$scenario['session']['id']);
expect($lane)->not->toBeNull()
->and($lane['relay_machine_id'])->toBe($scenario['relay_ids']['machine'])
->and($session)->not->toBeNull()
->and($session['reg'])->toBe($scenario['vehicle']['reg']);
});