<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class AdminJsShouldIncludeAutoOpenPlatformOrderFiltersOnAnchorTest extends TestCase
{
    use RefreshDatabase;

    public function test_admin_js_should_include_auto_open_filters_logic(): void
    {
        $js = file_get_contents(public_path('js/admin.js'));

        $this->assertIsString($js);

        // 关键口径：hash=#filters 时，自动展开 #filters（details）
        $this->assertStringContainsString("#filters", $js);
        $this->assertStringContainsString("location.hash", $js);
        $this->assertStringContainsString("d.open = true", $js);
    }
}
