TenantAtlas/tests/Feature/Filament/ResolvedReferenceRenderingSmokeTest.php
ahmido 1b88d28739 feat: consolidate operation naming surfaces (#202)
## Summary
- align operator-visible OperationRun terminology to canonical `Operations` / `Operation` labels across shared links, notifications, verification/onboarding surfaces, summary widgets, and monitoring/detail pages
- add the Spec 171 planning artifacts under `specs/171-operations-naming-consolidation/`
- close the remaining tenant dashboard and admin copy drift found during browser smoke validation

## Validation
- `export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && vendor/bin/sail artisan test --compact tests/Unit/Support/RelatedNavigationResolverTest.php tests/Unit/Support/References/RelatedContextReferenceAdapterTest.php tests/Feature/OpsUx/NotificationViewRunLinkTest.php tests/Feature/Guards/ActionSurfaceContractTest.php tests/Feature/Operations/TenantlessOperationRunViewerTest.php tests/Feature/Filament/BackupSetResolvedReferencePresentationTest.php tests/Feature/Filament/TenantVerificationReportWidgetTest.php tests/Feature/Onboarding/OnboardingVerificationTest.php tests/Feature/Onboarding/OnboardingVerificationClustersTest.php tests/Feature/Onboarding/OnboardingVerificationV1_5UxTest.php tests/Feature/Filament/BaselineCompareSummaryConsistencyTest.php tests/Feature/Filament/WorkspaceOverviewContentTest.php tests/Feature/Filament/RecentOperationsSummaryWidgetTest.php tests/Feature/Monitoring/OperationLifecycleAggregateVisibilityTest.php tests/Feature/System/Spec114/OpsTriageActionsTest.php tests/Feature/System/Spec114/OpsFailuresViewTest.php tests/Feature/System/Spec114/OpsStuckViewTest.php`
- `export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && vendor/bin/sail artisan test --compact tests/Browser/OnboardingDraftRefreshTest.php`
- `export PATH="/bin:/usr/bin:/usr/local/bin:$PATH" && vendor/bin/sail bin pint --dirty --format agent`

## Notes
- no schema or route renames
- Filament / Livewire surface behavior stays within the existing admin and tenant panels
- OperationRunResource remains excluded from global search

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #202
2026-03-30 22:51:06 +00:00

96 lines
3.8 KiB
PHP

<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Blade;
it('renders the resolved reference detail partial', function (): void {
$html = Blade::render(
"@include('filament.infolists.entries.resolved-reference-detail', ['reference' => \$reference])",
[
'reference' => [
'primaryLabel' => 'Windows Lockdown',
'secondaryLabel' => 'Version 3',
'stateLabel' => 'Resolved',
'stateColor' => 'success',
'stateIcon' => 'heroicon-m-check-circle',
'stateDescription' => null,
'showStateBadge' => false,
'isLinkable' => true,
'linkTarget' => [
'url' => '/admin/t/1/policy-versions/42',
'actionLabel' => 'View policy version',
'contextBadge' => 'Tenant',
],
'technicalDetail' => [
'displayId' => '42',
'fullId' => '42',
'sourceHint' => 'Captured from drift evidence',
],
],
],
);
expect($html)->toContain('Windows Lockdown')
->and($html)->toContain('Version 3')
->and($html)->not->toContain('Resolved')
->and($html)->toContain('Captured from drift evidence');
});
it('renders related-context actions after badges for both reference and fallback entries', function (): void {
$html = Blade::render(
"@include('filament.infolists.entries.related-context', ['entries' => \$entries])",
[
'entries' => [
[
'label' => 'Operation',
'reference' => [
'primaryLabel' => 'Backup set update',
'secondaryLabel' => 'Operation #189',
'stateLabel' => 'Resolved',
'stateColor' => 'success',
'stateIcon' => 'heroicon-m-check-circle',
'stateDescription' => null,
'showStateBadge' => false,
'isLinkable' => true,
'linkTarget' => [
'url' => '/admin/operations/189',
'actionLabel' => 'Open operation',
'contextBadge' => 'Tenant context',
],
'technicalDetail' => [
'displayId' => '189',
'fullId' => '189',
'sourceHint' => null,
],
],
],
[
'label' => 'Operations',
'value' => 'Operations',
'secondaryValue' => 'YPTW2',
'targetUrl' => '/admin/t/demo/operations',
'targetKind' => 'operations',
'availability' => 'available',
'unavailableReason' => null,
'contextBadge' => 'Workspace context',
'priority' => 20,
'actionLabel' => 'Inspect operations',
],
],
],
);
$referenceBadgePosition = strpos($html, 'Tenant context');
$referenceActionPosition = strpos($html, 'Open operation');
$fallbackBadgePosition = strpos($html, 'Workspace context');
$fallbackActionPosition = strpos($html, 'Inspect operations');
expect($referenceBadgePosition)->not->toBeFalse()
->and($referenceActionPosition)->not->toBeFalse()
->and($fallbackBadgePosition)->not->toBeFalse()
->and($fallbackActionPosition)->not->toBeFalse()
->and($referenceBadgePosition)->toBeLessThan($referenceActionPosition)
->and($fallbackBadgePosition)->toBeLessThan($fallbackActionPosition);
});