<?php

namespace Tests\Feature;

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

class AdminJsCopyLinkButtonsShouldHaveTemporaryFeedbackLogicTest extends TestCase
{
    use RefreshDatabase;

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

        $this->assertIsString($js);

        // 关键口径：复制后按钮短暂变为“已复制/复制失败”，并 disable
        $this->assertStringContainsString('markCopied', $js);
        $this->assertStringContainsString("'已复制'", $js);
        $this->assertStringContainsString("'复制失败'", $js);
        $this->assertStringContainsString('btn.disabled = true', $js);
    }
}
