Added shareable reports

This commit is contained in:
Constantin Graf
2024-08-13 16:21:59 +02:00
committed by Constantin Graf
parent 0ee0175f04
commit c03aad1abd
30 changed files with 1912 additions and 141 deletions

View File

@@ -930,6 +930,25 @@ class TimeEntryEndpointTest extends ApiEndpointTestAbstract
$response->assertForbidden();
}
public function test_aggregate_endpoint_fails_if_request_has_sub_group_but_no_group(): void
{
// Arrange
$data = $this->createUserWithPermission([
'time-entries:view:all',
]);
Passport::actingAs($data->user);
// Act
$response = $this->getJson(route('api.v1.time-entries.aggregate', [
$data->organization->getKey(),
'sub_group' => TimeEntryAggregationType::Task->value,
]));
// Assert
$response->assertStatus(422);
$response->assertJsonValidationErrorFor('group');
}
public function test_aggregate_endpoint_works_for_user_with_only_access_to_own_time_entries(): void
{
// Arrange