<?php

declare(strict_types=1);

use App\Support\Audit\AuditActionId;

it('labels and summarizes canonical audit taxonomy values', function (): void {
    expect(AuditActionId::labelFor(AuditActionId::BaselineProfileUpdated))
        ->toBe('Baseline profile updated');

    expect(AuditActionId::summaryFor(
        action: AuditActionId::BaselineProfileUpdated,
        targetLabel: 'Windows baseline',
    ))->toBe('Baseline profile updated for Windows baseline');
});

it('keeps legacy event ids readable and appends transition context when available', function (): void {
    expect(AuditActionId::labelFor('finding.risk_accepted'))
        ->toBe('Finding risk accepted');

    expect(AuditActionId::summaryFor(
        action: 'finding.triaged',
        targetLabel: 'Drift finding #42',
        context: [
            'before_status' => 'new',
            'after_status' => 'triaged',
        ],
    ))->toBe('Finding triaged for Drift finding #42 (new -> triaged)');
});
