<?php

use App\Support\OpsUx\OperationSummaryKeys;

it('matches the canonical summary keys declared in spec.md', function () {
    $specPath = repo_path('specs/055-ops-ux-rollout/spec.md');
    $spec = file_get_contents($specPath);

    // Extract the backtick-enclosed comma-separated canonical list from spec.md
    $matched = preg_match('/The following keys are the ONLY allowed summary keys[\s\S]*?`([^`]*)`/i', $spec, $m);
    expect($matched)->toBeTruthy();

    $specList = array_map('trim', explode(',', $m[1]));

    $codeList = OperationSummaryKeys::all();

    expect($codeList)->toEqual($specList);
})->group('ops-ux');
