actingAs($user); $tenant->makeCurrent(); Filament::setTenant($tenant, true); $profile = BaselineProfile::factory()->active()->create([ 'workspace_id' => (int) $tenant->workspace_id, 'scope_jsonb' => ['policy_types' => ['deviceConfiguration'], 'foundation_types' => []], ]); $snapshot = BaselineSnapshot::factory()->create([ 'workspace_id' => (int) $tenant->workspace_id, 'baseline_profile_id' => (int) $profile->getKey(), ]); $profile->update(['active_snapshot_id' => (int) $snapshot->getKey()]); BaselineTenantAssignment::factory()->create([ 'workspace_id' => (int) $tenant->workspace_id, 'tenant_id' => (int) $tenant->getKey(), 'baseline_profile_id' => (int) $profile->getKey(), ]); $displayName = 'Duplicate Policy'; InventoryItem::factory()->create([ 'tenant_id' => (int) $tenant->getKey(), 'workspace_id' => (int) $tenant->workspace_id, 'external_id' => 'dup-1', 'policy_type' => 'deviceConfiguration', 'display_name' => $displayName, ]); InventoryItem::factory()->create([ 'tenant_id' => (int) $tenant->getKey(), 'workspace_id' => (int) $tenant->workspace_id, 'external_id' => 'dup-2', 'policy_type' => 'deviceConfiguration', 'display_name' => $displayName, ]); Livewire::test(BaselineCompareLanding::class) ->assertSee(__('baseline-compare.duplicate_warning_title')) ->assertSee('share the same display name') ->assertSee('cannot match them to the baseline'); });