Skip to content

Commit

Permalink
refactor: update category test wording
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Sep 6, 2024
1 parent 7b1914b commit 2de9d96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/src/Admin/Features/CategoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

0 comments on commit 2de9d96

Please sign in to comment.