first commit
This commit is contained in:
16
tests/Feature/TimeTrackerTest.php
Normal file
16
tests/Feature/TimeTrackerTest.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
test('an user can start a time tracker', function () {
|
||||
Sanctum::actingAs($user = User::factory()->create());
|
||||
|
||||
$this->postJson('/api/time-tracker', [])
|
||||
->assertCreated()
|
||||
->assertJson([
|
||||
'id' => $user->timeTrackers()->value('id'),
|
||||
'user_id' => $user->id,
|
||||
'start_at' => now()->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user