Files
api/services/nginx/app/tests/Unit/Selfserve/SelfserveSchemaBootstrapCompatibilityTest.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

29 lines
1.6 KiB
PHP

<?php
it('adds dynamic_images_vehicle_type column for legacy selfserve wash session task schemas', function (): void {
$bootstrapContent = file_get_contents(app_path('classes/selfserve_schema_bootstrap.php'));
expect($bootstrapContent)->not->toBeFalse();
expect($bootstrapContent)->toContain("'selfserve_wash_session_tasks'");
expect($bootstrapContent)->toContain("'dynamic_images_vehicle_type'");
expect($bootstrapContent)->toContain('ALTER TABLE selfserve_wash_session_tasks ADD COLUMN dynamic_images_vehicle_type INT NULL AFTER buttons');
});
it('adds wash_started_at column for legacy selfserve wash session schemas', function (): void {
$bootstrapContent = file_get_contents(app_path('classes/selfserve_schema_bootstrap.php'));
expect($bootstrapContent)->not->toBeFalse();
expect($bootstrapContent)->toContain("'selfserve_wash_sessions'");
expect($bootstrapContent)->toContain("'wash_started_at'");
expect($bootstrapContent)->toContain('ALTER TABLE selfserve_wash_sessions ADD COLUMN wash_started_at DATETIME NULL AFTER machine_start_triggered_at');
});
it('creates canvas-only self-serve studio layout storage', function (): void {
$bootstrapContent = file_get_contents(app_path('classes/selfserve_schema_bootstrap.php'));
expect($bootstrapContent)->not->toBeFalse();
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS department_selfserve_studio_layouts');
expect($bootstrapContent)->toContain('layout_json JSON NOT NULL');
expect($bootstrapContent)->toContain('idx_department_selfserve_studio_layouts_department_user');
});