diff --git a/resources/views/components/jobs/board/menu.blade.php b/resources/views/components/jobs/board/menu.blade.php index 72259ec..203cbf7 100644 --- a/resources/views/components/jobs/board/menu.blade.php +++ b/resources/views/components/jobs/board/menu.blade.php @@ -43,7 +43,7 @@ type="button" role="menuitemradio" aria-checked="{{ $value === $current ? 'true' : 'false' }}" - wire:click="{{ $method }}({{ collect([...$args, $value])->map(fn ($arg) => Js::from($arg))->join(', ') }})" + wire:click="{{ $method }}({{ collect([...$args, $value])->map(fn ($arg): string => Js::from($arg)->toHtml())->implode(', ') }})" x-on:click="open = false; $refs.button.focus()" x-on:keydown.arrow-down.prevent="$el.nextElementSibling?.focus()" x-on:keydown.arrow-up.prevent="$el.previousElementSibling?.matches('button') && $el.previousElementSibling.focus()" diff --git a/tests/Browser/JobsAccessibilityTest.php b/tests/Browser/JobsAccessibilityTest.php index aebdca1..758e708 100644 --- a/tests/Browser/JobsAccessibilityTest.php +++ b/tests/Browser/JobsAccessibilityTest.php @@ -212,6 +212,19 @@ it('keeps the task list of a card open when the board is opened again', function ->assertNoAccessibilityIssues(level: 2); }); +it('changes the order of a column and the urgent threshold from the column menus', function () { + visit(route('jobs.board')) + ->on()->desktop() + ->click('[aria-controls="sort-menu-order"]') + ->click('#sort-menu-order [aria-checked="false"]') + ->assertSee('Listan Jonossa järjestys: Eräpäivän mukaan.') + ->click('[aria-controls="threshold-menu"]') + ->click('#threshold-menu button:first-of-type') + ->assertSee('Kiire-listaan nousevat nyt: Vain Heti.') + ->assertNoJavaScriptErrors() + ->assertNoAccessibilityIssues(level: 2); +}); + it('marks a task done from the task panel of a card', function () { $this->job->update(['status' => 'in_production']); $task = TaskModel::factory()->create(['customer_job_id' => $this->job->id, 'title' => 'Leikkaus', 'status' => 'in_progress']); diff --git a/tests/Feature/Modules/Jobs/JobBoardTest.php b/tests/Feature/Modules/Jobs/JobBoardTest.php index 82f7e2f..6866ab6 100644 --- a/tests/Feature/Modules/Jobs/JobBoardTest.php +++ b/tests/Feature/Modules/Jobs/JobBoardTest.php @@ -286,3 +286,9 @@ it('remembers for each user which cards have their tasks open', function () { $this->actingAs($colleague); Livewire::test('jobs::board')->assertDontSeeHtml('aria-expanded="true"'); }); + +it('passes the column and choice to the order and urgent threshold menus', function () { + Livewire::test('jobs::board') + ->assertSeeHtml('wire:click="setColumnSort('order', 'due_date')"') + ->assertSeeHtml('wire:click="setUrgentThreshold('immediate')"'); +});