Show the task's due date in the calendar's schedule dialog
The dialog shows the due date as a read-only field; it is changed on the task's edit page. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -96,6 +96,18 @@ it('changes the schedule and status in the dialog and takes a task out of the ca
|
||||
->and($task->planned_from)->toBeNull();
|
||||
});
|
||||
|
||||
it('shows the task due date in the dialog', function () {
|
||||
$due = calendarTaskModel(['customer_job_id' => $this->job->id, 'work_type_id' => $this->graphic->id, 'title' => 'Mainoskuvat', 'due_on' => '2026-12-24', 'planned_from' => '2026-12-22', 'planned_to' => '2026-12-22'], [$this->employee->id]);
|
||||
$open = calendarTaskModel(['customer_job_id' => $this->job->id, 'work_type_id' => $this->graphic->id, 'title' => 'Taitto', 'due_on' => null, 'planned_from' => '2026-12-22', 'planned_to' => '2026-12-22'], [$this->employee->id]);
|
||||
|
||||
Livewire::test('jobs::calendar')
|
||||
->call('openDialog', $due->id, $this->employee->id)
|
||||
->assertSet('dialogDueOn', '24.12.2026')
|
||||
->assertSee('Määräaika')
|
||||
->call('openDialog', $open->id, $this->employee->id)
|
||||
->assertSet('dialogDueOn', __('jobs.not_set'));
|
||||
});
|
||||
|
||||
it('shows a subcontractor only their own row and lets them change only the status', function () {
|
||||
$subcontractor = User::factory()->subcontractor()->create(['name' => 'Ville Alihankkija']);
|
||||
DB::table('customer_job_members')->insert(['customer_job_id' => $this->job->id, 'user_id' => $subcontractor->id]);
|
||||
|
||||
Reference in New Issue
Block a user