add some test

This commit is contained in:
Romulus21
2024-04-01 19:47:15 +02:00
parent 8fcf3dd680
commit 1065da076d
7 changed files with 102 additions and 14 deletions

View File

@@ -71,7 +71,7 @@ test('an user can retrieve a to do', function () {
Sanctum::actingAs($this->user);
$toDos = ToDo::factory()->count(10)->create([
'user_id' => $this->user->id,
'checked' => false,
'checked' => null,
]);
$toDo = $toDos[rand(0, 9)];
@@ -91,7 +91,7 @@ test('an user can update a to do', function () {
Sanctum::actingAs($this->user);
$toDos = ToDo::factory()->count(10)->create([
'user_id' => $this->user->id,
'checked' => false,
'checked' => null,
]);
$toDo = $toDos[rand(0, 9)];
@@ -103,7 +103,7 @@ test('an user can update a to do', function () {
'id' => $toDo->id,
'user_id' => $toDo->user_id,
'name' => 'update test',
'checked' => false,
'checked' => null,
]);
expect(ToDo::find($toDo->id))
@@ -114,7 +114,7 @@ test('an user can delete a to do', function () {
Sanctum::actingAs($this->user);
$toDos = ToDo::factory()->count(10)->create([
'user_id' => $this->user->id,
'checked' => false,
'checked' => null,
]);
$toDo = $toDos[rand(0, 9)];