- Invoice listing in frontend

This commit is contained in:
Peter Papp
2021-04-21 16:53:39 +02:00
parent 5a9583be5b
commit eae212ac5d
22 changed files with 279 additions and 99 deletions

View File

@@ -3,7 +3,9 @@
namespace Tests\Feature\Oasis;
use App\Models\Oasis\Client;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
class OasisClientTest extends TestCase
@@ -22,4 +24,26 @@ class OasisClientTest extends TestCase
'name' => $client->name,
]);
}
/**
* @test
*/
public function it_get_all_clients()
{
$user = User::factory(User::class)
->create(['role' => 'user']);
Sanctum::actingAs($user);
$client = Client::factory(Client::class)
->create([
'user_id' => $user->id,
]);
$this->getJson('/api/oasis/clients')
->assertJsonFragment([
'id' => $client->id,
'user_id' => $user->id,
])->assertStatus(200);
}
}