From 2de9d966b446d6f4638a92c11c23037d238ccf4d Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Fri, 6 Sep 2024 14:13:44 +0200 Subject: [PATCH] refactor: update category test wording --- tests/src/Admin/Features/CategoryTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/Admin/Features/CategoryTest.php b/tests/src/Admin/Features/CategoryTest.php index 1ac49ea79..99dfad7c3 100644 --- a/tests/src/Admin/Features/CategoryTest.php +++ b/tests/src/Admin/Features/CategoryTest.php @@ -72,19 +72,19 @@ ->call('save') ->assertHasNoFormErrors() ->assertDispatched('category-save'); + expect((new CategoryRepository)->count())->toBe(2); }); - it('can set parent_id child to null if parent are deleted', function (): void { + it('has parent_id field null when parent category is deleted', function (): void { $parent = Category::factory()->create(['name' => 'Parent']); - $child = Category::factory()->create(['name' => 'Enfant', 'parent_id' => $parent->id]); + $child = Category::factory()->create(['name' => 'Child', 'parent_id' => $parent->id]); expect($child->parent_id)->toBe($parent->id); $parent->delete(); - $child->refresh(); + expect($child->parent_id)->toBeNull(); }); - })->group('category');