<?php

it('nullifies department lane relay fields when blank select values are submitted', function (): void {
    $route = file_get_contents(app_path('routes/departmentLanesRoute.php'));

    expect($route)->not->toBeFalse();
    expect($route)->toContain('private static function normalizeRelayRequestParameter');
    expect($route)->toContain('private static function syncDepartmentLaneRelayValue');
    expect($route)->toContain('$field->nullify();');
    expect($route)->toContain('self::syncDepartmentLaneRelayValue($department_lane->relay_in_id, $relay_in_id);');
    expect($route)->toContain('self::syncDepartmentLaneRelayValue($department_lane->relay_out_id, $relay_out_id);');
    expect($route)->toContain('self::syncDepartmentLaneRelayValue($department_lane->relay_machine_id, $relay_machine_id);');
    expect($route)->toContain(
        'self::syncDepartmentLaneRelayValue($department_lane->relay_machine_program_picker_id, $relay_machine_program_picker_id);'
    );
    expect($route)->toContain('self::syncDepartmentLaneRelayValue($department_lane->relay_machine_cleaner_id, $relay_machine_cleaner_id);');
});
