Add .gitattributes for binary files and extend order booking update tests. Enhance dynamic image and routing logic with program_picker support.

This commit is contained in:
Jeppe Bundgaard
2026-05-26 14:04:27 +02:00
parent f1c123a840
commit bc7c0280f2
23 changed files with 9296 additions and 3064 deletions
@@ -38,8 +38,9 @@ namespace {
expect($content)->toContain("switch (\$dynamic_image_id)");
});
it('accepts ordered dynamic image button tokens including reset start and zero', function (): void {
expect(department_selfserve_tasks_o::normalizeButtonsInput('["reset",0,2,"start",5]'))->toBe([
it('accepts ordered dynamic image button tokens including program picker reset start and zero', function (): void {
expect(department_selfserve_tasks_o::normalizeButtonsInput('["program_picker","reset",0,2,"start",5]'))->toBe([
'program_picker',
'reset',
0,
2,
@@ -50,7 +51,7 @@ namespace {
$route = file_get_contents(app_path('routes/departmentLanesRoute.php'));
expect($route)->not->toBeFalse();
expect($route)->toContain('ordered highlighted button IDs');
expect($route)->toContain('"reset", or "start"');
expect($route)->toContain('"reset", "start", or "program_picker"');
});
it('renders machine one dynamic image steps from the ordered button payload', function (): void {
@@ -60,13 +61,14 @@ namespace {
expect($content)->toContain('$deferredStartButtons = $this->drawHighlightedButtonSequence();');
expect($content)->toContain('getOrderedHighlightedButtonTokens');
expect($content)->toContain('normalizeHighlightedButtonToken');
expect($content)->toContain("const BUTTON_PROGRAM_PICKER = 'program_picker'");
expect($content)->toContain('getProgramPickerStepCoordinates');
expect($content)->toContain('drawDeferredHighlightedButtons($deferredStartButtons)');
expect($content)->toContain('self::BUTTON_PROGRAM_PICKER');
$thumbOffset = strpos($content, 'public function drawStepThumb');
expect($thumbOffset)->not->toBeFalse();
$thumbBody = substr($content, (int)$thumbOffset, 1800);
expect($thumbBody)->toContain('self::IMAGE_BUTTON_HIGHLIGHTED_BLUE');
expect($thumbBody)->not->toContain('drawStepCounterOnButton');
expect($thumbBody)->not->toContain('only_generate_current_step');
$setupOffset = strpos($content, 'public function setup');
expect($setupOffset)->not->toBeFalse();
$setupBody = substr($content, (int)$setupOffset, 1000);
expect($setupBody)->not->toContain('drawStepThumb();');
});
}