Colour overloaded days and late tasks in the task calendar

Days over the daily capacity are amber and late task bars red, next to
the existing icon and text.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-25 11:00:36 +02:00
co-authored by Claude Sonnet 5.5
parent 7c605014c7
commit 912b4ae1b5
2 changed files with 28 additions and 7 deletions
@@ -5,6 +5,7 @@ use App\Modules\Catalog\Infrastructure\Persistence\Eloquent\WorkTypeModel;
use App\Modules\Jobs\Infrastructure\Persistence\Eloquent\CustomerJobModel;
use App\Modules\Jobs\Infrastructure\Persistence\Eloquent\TaskModel;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
uses(RefreshDatabase::class);
@@ -28,6 +29,12 @@ beforeEach(function () {
});
it('has no accessibility issues on the task calendar', function (string $device, string $colorScheme) {
// A day over the daily capacity and a late task (Leikkaus ends after its due date) get warning colours.
DB::table('task_bookings')->insert([
['task_id' => $this->task->id, 'user_id' => $this->user->id, 'day' => now()->toDateString(), 'minutes' => 600],
['task_id' => $this->task->id, 'user_id' => $this->user->id, 'day' => now()->addDays(2)->toDateString(), 'minutes' => 60],
]);
$visit = visit(route('jobs.calendar'));
$visit = $device === 'mobile' ? $visit->on()->mobile() : $visit->on()->desktop();
$visit = $colorScheme === 'dark' ? $visit->inDarkMode() : $visit->inLightMode();
@@ -35,7 +42,14 @@ it('has no accessibility issues on the task calendar', function (string $device,
$visit->assertNoJavaScriptErrors()
->assertSee('Leikkaus')
->assertSee('Värimäärittely')
->assertNoAccessibilityIssues(level: 2);
->assertSee('Myöhässä');
// Phones show an agenda list without the daily load.
if ($device === 'desktop') {
$visit->assertSee('10 / 7,5 h');
}
$visit->assertNoAccessibilityIssues(level: 2);
})->with([
'desktop, light' => ['desktop', 'light'],
'desktop, dark' => ['desktop', 'dark'],