intermin fix for board move, final fix all working, and also tests
This commit is contained in:
@@ -48,6 +48,44 @@ final class KanbanBoardTest extends TestCase
|
||||
->assertSee('High');
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function test_ticket_can_be_moved_to_another_board(): void
|
||||
{
|
||||
$lookups = $this->seedLookupData();
|
||||
$user = $this->admin();
|
||||
|
||||
$boardA = $lookups['board'];
|
||||
|
||||
$boardB = KanbanBoardModel::query()->create([
|
||||
'name' => 'Regression Target Board',
|
||||
'slug' => 'regression-target-board',
|
||||
'is_default' => false,
|
||||
'sort_order' => 50,
|
||||
]);
|
||||
|
||||
$boardB->statuses()->sync([
|
||||
$lookups['open']->id => ['sort_order' => 10],
|
||||
]);
|
||||
|
||||
$ticket = $this->ticket([
|
||||
'owner' => $user,
|
||||
'status_id' => $lookups['open']->id,
|
||||
'priority_id' => $lookups['normal']->id,
|
||||
'board_id' => $boardA->id,
|
||||
]);
|
||||
|
||||
$this->actingAs($user);
|
||||
|
||||
Livewire::test(KanbanBoard::class)
|
||||
->call('moveTicketToBoard', $ticket->id, $boardB->id)
|
||||
->assertHasNoErrors();
|
||||
|
||||
$ticket->refresh();
|
||||
|
||||
$this->assertSame($boardB->id, $ticket->board_id);
|
||||
$this->assertSame($lookups['open']->id, $ticket->status_id);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function kanban_board_can_move_ticket_to_closed_status(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user