<?php

namespace MintyPHP\Tests\Architecture;

use PHPUnit\Framework\TestCase;

final class DetailActionPolicyPartialContractTest extends TestCase
{
    use ProjectFileAssertionSupport;

    public function testDetailsPartialsExposeActionPolicyContract(): void
    {
        $titlebar = $this->readProjectFile('templates/partials/app-details-titlebar.phtml');
        $this->assertStringContainsString('data-detail-action-policy="1"', $titlebar);
        $this->assertStringContainsString('data-detail-action-kind=', $titlebar);
        $this->assertStringContainsString('data-detail-confirm-message=', $titlebar);

        $asideActions = $this->readProjectFile('templates/partials/app-details-aside-actions.phtml');
        $this->assertStringContainsString('data-detail-confirm-message=', $asideActions);

        $danger = $this->readProjectFile('templates/partials/app-danger-zone-delete-field.phtml');
        $this->assertStringContainsString('data-detail-action-kind="delete"', $danger);
    }
}
