Skip to content

Commit

Permalink
Fixed broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Aug 27, 2024
1 parent ee77de0 commit 0245ecc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Service/TimeEntryAggregationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ public function getAggregatedTimeEntries(Builder $timeEntriesQuery, ?TimeEntryAg
if ($groupBy !== null) {
$timeEntriesQuery->groupBy($groupBy);
}
if ($group1Select !== null) {
$timeEntriesQuery->orderBy('group_1');
if ($group2Select !== null) {
$timeEntriesQuery->orderBy('group_2');
}
}

$timeEntriesAggregates = $timeEntriesQuery->get();

Expand Down
6 changes: 6 additions & 0 deletions tests/Unit/Service/Export/ExportServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use App\Models\Client;
use App\Models\Member;
use App\Models\Organization;
use App\Models\OrganizationInvitation;
use App\Models\Project;
use App\Models\ProjectMember;
use App\Models\Tag;
use App\Models\Task;
use App\Models\TimeEntry;
use App\Models\User;
Expand All @@ -27,6 +29,8 @@ private function getFullOrganization(): Organization
$user1 = User::factory()->create();
$user2 = User::factory()->create();
$organization = Organization::factory()->withOwner($user1)->create();
OrganizationInvitation::factory()->forOrganization($organization)->create();
OrganizationInvitation::factory()->forOrganization($organization)->create();
$member1 = Member::factory()->forUser($user1)->forOrganization($organization)->create();
$member2 = Member::factory()->forUser($user2)->forOrganization($organization)->create();
$timeEntry1 = TimeEntry::factory()->forMember($member1)->create();
Expand All @@ -40,6 +44,8 @@ private function getFullOrganization(): Organization
$projectMember2 = ProjectMember::factory()->forMember($member2)->forProject($project1)->create();
$client1 = Client::factory()->forOrganization($organization)->create();
$client2 = Client::factory()->forOrganization($organization)->create();
Tag::factory()->forOrganization($organization)->create();
Tag::factory()->forOrganization($organization)->create();

return $organization;
}
Expand Down

0 comments on commit 0245ecc

Please sign in to comment.