Replace the demo home page with a dashboard
Everyone sees their open tasks on an agenda, their open jobs, this week's hours and quick links. Admin and management also get a lazily loaded management panel: things to do, the month so far against the previous month, jobs and late work, and everyone's workload. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -32,9 +32,7 @@ it('can be operated with the keyboard alone', function () {
|
||||
->assertScript('document.activeElement.textContent.trim()', 'Siirry pääsisältöön')
|
||||
->keys('a[href="#main-content"]', 'Enter')
|
||||
->keys('#main-content', 'Tab')
|
||||
->assertScript('document.activeElement.textContent.trim()', 'Lisää klikkaus')
|
||||
->keys('#main-content button', 'Enter')
|
||||
->assertSeeIn('[role="status"]', 'Klikattu 1 kertaa');
|
||||
->assertScript('document.activeElement.textContent.trim()', 'Pikavastaanotto');
|
||||
});
|
||||
|
||||
it('reaches the main menu with the keyboard', function () {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use App\Modules\Customers\Infrastructure\Persistence\Eloquent\CustomerModel;
|
||||
use App\Modules\Jobs\Domain\Enums\JobStatus;
|
||||
use App\Modules\Jobs\Infrastructure\Persistence\Eloquent\CustomerJobModel;
|
||||
use App\Modules\Jobs\Infrastructure\Persistence\Eloquent\TaskModel;
|
||||
use App\Modules\TimeTracking\Infrastructure\Persistence\Eloquent\TimeEntryModel;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
$this->worker = User::factory()->employee()->create(['name' => 'Aino Tekijä']);
|
||||
$job = CustomerJobModel::factory()->create([
|
||||
'name' => 'Mainosvideo',
|
||||
'customer_id' => CustomerModel::factory()->company()->create()->id,
|
||||
'status' => JobStatus::InProduction,
|
||||
'responsible_user_id' => $this->worker->id,
|
||||
'due_on' => now()->subDays(3)->toDateString(),
|
||||
]);
|
||||
$task = TaskModel::factory()->create(['customer_job_id' => $job->id, 'title' => 'Leikkaus', 'assignee_user_id' => $this->worker->id, 'due_on' => now()->subDay()->toDateString()]);
|
||||
TaskModel::factory()->create(['customer_job_id' => $job->id, 'title' => 'Värimäärittely', 'assignee_user_id' => $this->worker->id, 'due_on' => now()->toDateString()]);
|
||||
TimeEntryModel::factory()->create(['user_id' => $this->worker->id, 'task_id' => $task->id, 'worked_on' => now()->toDateString(), 'hours' => 2]);
|
||||
});
|
||||
|
||||
it('has no accessibility issues on the home page', function (string $role, string $device, string $colorScheme) {
|
||||
$this->actingAs($role === 'management' ? User::factory()->management()->create(['name' => 'Maija Johtaja']) : $this->worker);
|
||||
|
||||
$visit = visit(route('home'));
|
||||
$visit = $device === 'mobile' ? $visit->on()->mobile() : $visit->on()->desktop();
|
||||
$visit = $colorScheme === 'dark' ? $visit->inDarkMode() : $visit->inLightMode();
|
||||
|
||||
$role === 'management'
|
||||
? $visit->assertSee('Henkilöiden kuormitus')->assertSee('Leikkaus')
|
||||
: $visit->assertSee('Leikkaus')->assertSee('Värimäärittely')->assertDontSee('Johtajapaneeli');
|
||||
|
||||
$visit->assertNoJavaScriptErrors()
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
})->with(['employee', 'management'])->with([
|
||||
'desktop, light' => ['desktop', 'light'],
|
||||
'desktop, dark' => ['desktop', 'dark'],
|
||||
'mobile, light' => ['mobile', 'light'],
|
||||
'mobile, dark' => ['mobile', 'dark'],
|
||||
]);
|
||||
Reference in New Issue
Block a user