<?php

namespace Tests\Feature;

use Tests\TestCase;

class AdminJsShouldAutoOpenRefundReceiptDetailsWhenHashPresentTest extends TestCase
{
    public function test_admin_js_should_auto_open_refund_receipt_details_when_hash_present(): void
    {
        $js = (string) file_get_contents(public_path('js/admin.js'));

        // 护栏：当 hash 为 #add-refund-receipt 时，应自动展开 details#add-refund-receipt（追加退款记录面板）。
        $this->assertStringContainsString("'#add-refund-receipt': 'details#add-refund-receipt'", $js);
        $this->assertStringContainsString('if (map[h])', $js);
        $this->assertStringContainsString('d.open = true', $js);
    }
}
