active()->create([ 'workspace_id' => (int) $tenant->workspace_id, ]); $snapshot = BaselineSnapshot::factory()->incomplete(BaselineReasonCodes::SNAPSHOT_CAPTURE_FAILED)->create([ 'workspace_id' => (int) $tenant->workspace_id, 'baseline_profile_id' => (int) $profile->getKey(), ]); setAdminPanelContext(); session()->put(WorkspaceContext::SESSION_KEY, (int) $tenant->workspace_id); $truth = app(ArtifactTruthPresenter::class)->forBaselineSnapshot($snapshot->fresh()); $explanation = $truth->operatorExplanation; $this->actingAs($user) ->get(BaselineSnapshotResource::getUrl(panel: 'admin')) ->assertOk() ->assertSee($explanation?->headline ?? '') ->assertSee($explanation?->nextActionText ?? ''); $this->actingAs($user) ->get(BaselineSnapshotResource::getUrl('view', ['record' => $snapshot], panel: 'admin')) ->assertOk() ->assertSee('Result meaning') ->assertSee($explanation?->evaluationResultLabel() ?? '') ->assertSee('Result trust') ->assertSee($explanation?->trustworthinessLabel() ?? '') ->assertSee($explanation?->nextActionText ?? ''); });