feat(js): 复制成功不再alert(仅toast+按钮短反馈)

This commit is contained in:
萝卜
2026-03-17 17:31:21 +08:00
parent c48c4e7470
commit 5a72d89e6f
2 changed files with 24 additions and 9 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminJsCopySuccessShouldNotUseAlertTest extends TestCase
{
use RefreshDatabase;
public function test_copy_success_should_not_use_alert(): void
{
$js = file_get_contents(public_path('js/admin.js'));
$this->assertIsString($js);
// 成功路径不应再依赖 alert用 toast + 按钮短反馈即可)
$this->assertStringNotContainsString("window.alert('已复制", $js);
}
}