Added billable rates; Added project members; Added visibility to projects

This commit is contained in:
Constantin Graf
2024-03-28 18:50:04 +01:00
parent bb42b0940a
commit ba0212ea01
71 changed files with 3236 additions and 174 deletions

View File

@@ -32,7 +32,7 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
$data = $this->createUserWithPermission([
'clients:view',
]);
$clients = Client::factory()->forOrganization($data->organization)->createMany(4);
$clients = Client::factory()->forOrganization($data->organization)->randomCreatedAt()->createMany(4);
Passport::actingAs($data->user);
// Act
@@ -41,15 +41,16 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
// Assert
$response->assertStatus(200);
$response->assertJsonCount(4, 'data');
$clients = Client::query()->orderBy('created_at', 'desc')->get();
$response->assertJson(fn (AssertableJson $json) => $json
->has('data')
->has('links')
->has('meta')
->count('data', 4)
->where('data.0.id', $clients->sortByDesc('created_at')->get(0)->getKey())
->where('data.1.id', $clients->sortByDesc('created_at')->get(1)->getKey())
->where('data.2.id', $clients->sortByDesc('created_at')->get(2)->getKey())
->where('data.3.id', $clients->sortByDesc('created_at')->get(3)->getKey())
->where('data.0.id', $clients->get(0)->getKey())
->where('data.1.id', $clients->get(1)->getKey())
->where('data.2.id', $clients->get(2)->getKey())
->where('data.3.id', $clients->get(3)->getKey())
);
}