<?php

namespace MintyPHP\Tests\Architecture;

use PHPUnit\Framework\TestCase;

final class AsideNavigationAdminContractTest extends TestCase
{
    use ProjectFileAssertionSupport;

    public function testAdminAsideUsesGroupedDetailsStorageContract(): void
    {
        $content = $this->readProjectFile('templates/partials/app-main-aside.phtml');

        $this->assertStringContainsString('data-aside-details-storage="aside-admin-sections-v1"', $content);
        $this->assertStringContainsString('data-aside-details-open-active="1"', $content);
        $this->assertStringContainsString('<details data-details-key="<?php e($groupKey); ?>"', $content);

        $this->assertStringContainsString("'key' => 'admin-organization'", $content);
        $this->assertStringContainsString("'key' => 'admin-roles-permissions'", $content);
        $this->assertStringContainsString("'key' => 'admin-automation'", $content);
        $this->assertStringNotContainsString("'key' => 'admin-monitoring'", $content);
        $this->assertStringContainsString("'key' => 'admin-logs'", $content);
        $this->assertStringContainsString("'key' => 'admin-system'", $content);
        $this->assertStringContainsString("'path' => 'admin/stats'", $content);
    }
}
