mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-11 17:52:15 +01:00
Added shareable reports
This commit is contained in:
committed by
Constantin Graf
parent
0ee0175f04
commit
c03aad1abd
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user