refactor(js): 复制失败toast文案收敛为toastCopyFailed并更新护栏

This commit is contained in:
萝卜
2026-03-17 17:43:58 +08:00
parent c245d872ca
commit 7f1f5a6887
3 changed files with 41 additions and 3 deletions

View File

@@ -15,6 +15,10 @@ class AdminJsCopyFailuresShouldUseToastErrorFirstTest extends TestCase
$this->assertIsString($js);
// 复制失败时应优先 toastErroralert 作为降级)
$this->assertStringContainsString("toastError('复制失败", $js);
// 允许通过 wrappertoastCopyFailed间接调用 toastError。
$this->assertTrue(
str_contains($js, "toastError('复制失败") || str_contains($js, 'toastCopyFailed('),
'copy failures should use toastError (directly or via toastCopyFailed wrapper)'
);
}
}