mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
Added missing chart data to dashboard endpoint
This commit is contained in:
@@ -7,6 +7,7 @@ namespace Tests\Unit\Model;
|
||||
use App\Models\Organization;
|
||||
use App\Models\Project;
|
||||
use App\Models\Task;
|
||||
use App\Models\TimeEntry;
|
||||
|
||||
class TaskModelTest extends ModelTestAbstract
|
||||
{
|
||||
@@ -39,4 +40,20 @@ class TaskModelTest extends ModelTestAbstract
|
||||
$this->assertNotNull($projectRel);
|
||||
$this->assertTrue($projectRel->is($project));
|
||||
}
|
||||
|
||||
public function test_it_has_many_time_entries(): void
|
||||
{
|
||||
// Arrange
|
||||
$otherTask = Task::factory()->create();
|
||||
$task = Task::factory()->create();
|
||||
$timeEntries = TimeEntry::factory()->forTask($task)->count(3)->create();
|
||||
$otherTimeEntries = TimeEntry::factory()->forTask($otherTask)->count(2)->create();
|
||||
|
||||
// Act
|
||||
$task->refresh();
|
||||
$timeEntries = $task->timeEntries;
|
||||
|
||||
// Assert
|
||||
$this->assertCount(3, $timeEntries);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user