<?php

namespace MintyPHP\Tests\Architecture;

use PHPUnit\Framework\TestCase;

final class AuthLoginTemplateAccessibilityContractTest extends TestCase
{
    use ProjectFileAssertionSupport;

    public function testAuthLoginTemplatesDoNotUseRoleButtonLinks(): void
    {
        foreach (AuthLoginAccessibilityContractFiles::authLoginTemplates() as $file) {
            $content = $this->readProjectFile($file);
            $this->assertStringNotContainsString('role="button"', $content, $file);
        }
    }

    public function testAuthLoginErrorNoticesUseAssertiveLiveRegions(): void
    {
        foreach (AuthLoginAccessibilityContractFiles::authLoginTemplates() as $file) {
            $content = $this->readProjectFile($file);
            $this->assertStringContainsString(
                'class="notice" data-variant="error" role="alert" aria-live="assertive"',
                $content,
                $file
            );
        }
    }
}
