Move billable rate restriction tests to the endpoint tests of the specific endpoints

This commit is contained in:
Constantin Graf
2026-10-14 13:29:32 +02:00
parent 24b937767e
commit 0fa6f8c005
7 changed files with 490 additions and 511 deletions

View File

@@ -300,4 +300,20 @@ class ChartEndpointTest extends EndpointTestAbstract
// Assert
$response->assertOk();
}
public function test_total_weekly_billable_amount_is_forbidden_if_organization_can_not_use_billable_rates(): void
{
// Arrange
$data = $this->createUserWithPermission([
'charts:view:own',
]);
$this->actAsOrganizationWithoutBillableRates();
Passport::actingAs($data->user);
// Act
$response = $this->getJson(route('api.v1.charts.total-weekly-billable-amount', [$data->organization->getKey()]));
// Assert
$response->assertForbidden();
}
}