Skip to content

Commit

Permalink
[TM-782] Fix lint and failing unit test from staging.
Browse files Browse the repository at this point in the history
  • Loading branch information
roguenet committed Apr 15, 2024
1 parent c4dbdef commit 58b023a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ public function __invoke(Request $request, string $entity, string $framework)
private function getSlug(string $framework)
{
$frameworkModel = Framework::where('access_code', $framework)->firstOrFail();

return $frameworkModel->slug;
}

private function getForm(string $modelClass, string $framework)
{
return Form::where('model', $modelClass)
Expand Down
3 changes: 3 additions & 0 deletions tests/V2/Exports/ExportAllMonitoredEntitiesControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Helpers\CustomFormHelper;
use App\Jobs\V2\GenerateAdminAllEntityRecordsExportJob;
use App\Models\Framework;
use App\Models\User;
use App\Models\V2\Nurseries\Nursery;
use App\Models\V2\Nurseries\NurseryReport;
Expand Down Expand Up @@ -31,6 +32,8 @@ public function test_an_admin_user_can_export_all_monitored_entities(string $per
$user = User::factory()->admin()->create();
$user->givePermissionTo($permission);

Framework::factory()->create(['slug' => $fmKey, 'access_code' => $fmKey]);

$testCases = [
'projects' => Project::factory()->count(5)->create(['framework_key' => $fmKey]),
'sites' => Site::factory()->count(5)->create(['framework_key' => $fmKey]),
Expand Down

0 comments on commit 58b023a

Please sign in to comment.