Skip to content

Commit 936e483

Browse files
committed
Fix Component tests
1 parent 68ffeab commit 936e483

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Unit/Models/ComponentTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

33
use Cachet\Enums\ComponentStatusEnum;
4+
use Cachet\Enums\IncidentStatusEnum;
45
use Cachet\Models\Component;
56
use Cachet\Models\ComponentGroup;
7+
use Cachet\Models\Incident;
68

79
it('has a group', function () {
810
$component = Component::factory()->forGroup([
@@ -15,7 +17,9 @@
1517
});
1618

1719
it('has incidents', function () {
18-
$component = Component::factory()->hasIncidents(2)->create();
20+
$component = Component::factory()->hasAttached(Incident::factory()->count(2), [
21+
'status' => IncidentStatusEnum::investigating,
22+
])->create();
1923

2024
expect($component->incidents)->toHaveCount(2);
2125
});

0 commit comments

Comments
 (0)