refactor(js): 提炼toast通用函数并保留toastSuccess封装

This commit is contained in:
萝卜
2026-03-17 17:17:27 +08:00
parent 0d3096d075
commit e93fda474b
2 changed files with 32 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminJsToastHelperShouldExistTest extends TestCase
{
use RefreshDatabase;
public function test_admin_js_should_include_toast_helper_and_toast_success_wrapper(): void
{
$js = file_get_contents(public_path('js/admin.js'));
$this->assertIsString($js);
$this->assertStringContainsString('function toast(', $js);
$this->assertStringContainsString("toast('success'", $js);
}
}