Pass the choice to the Kanban column menus (they called the action without it)

Collection::join() plucks from objects, so joining the Js arguments gave an
empty string and the sort and urgent threshold menus called
setColumnSort() / setUrgentThreshold() with no arguments (500).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-30 11:59:14 +02:00
co-authored by Claude Opus 5.5
parent 9eac4c4d4e
commit 8be732ada8
3 changed files with 20 additions and 1 deletions
@@ -43,7 +43,7 @@
type="button" type="button"
role="menuitemradio" role="menuitemradio"
aria-checked="{{ $value === $current ? 'true' : 'false' }}" 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:click="open = false; $refs.button.focus()"
x-on:keydown.arrow-down.prevent="$el.nextElementSibling?.focus()" x-on:keydown.arrow-down.prevent="$el.nextElementSibling?.focus()"
x-on:keydown.arrow-up.prevent="$el.previousElementSibling?.matches('button') && $el.previousElementSibling.focus()" x-on:keydown.arrow-up.prevent="$el.previousElementSibling?.matches('button') && $el.previousElementSibling.focus()"
+13
View File
@@ -212,6 +212,19 @@ it('keeps the task list of a card open when the board is opened again', function
->assertNoAccessibilityIssues(level: 2); ->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 () { it('marks a task done from the task panel of a card', function () {
$this->job->update(['status' => 'in_production']); $this->job->update(['status' => 'in_production']);
$task = TaskModel::factory()->create(['customer_job_id' => $this->job->id, 'title' => 'Leikkaus', 'status' => 'in_progress']); $task = TaskModel::factory()->create(['customer_job_id' => $this->job->id, 'title' => 'Leikkaus', 'status' => 'in_progress']);
@@ -286,3 +286,9 @@ it('remembers for each user which cards have their tasks open', function () {
$this->actingAs($colleague); $this->actingAs($colleague);
Livewire::test('jobs::board')->assertDontSeeHtml('aria-expanded="true"'); 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(&#039;order&#039;, &#039;due_date&#039;)"')
->assertSeeHtml('wire:click="setUrgentThreshold(&#039;immediate&#039;)"');
});