Files
saasshop/tests/Feature/AdminJsCopySuccessShouldNotUseAlertTest.php

21 lines
537 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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);
}
}