refactor(js): tempButtonFeedback提升为通用并前置于run_id复制处理

This commit is contained in:
萝卜
2026-03-17 17:11:19 +08:00
parent 9cfe7a718c
commit 0d3096d075
2 changed files with 56 additions and 54 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminJsTempButtonFeedbackShouldBeDefinedBeforeCopyRunIdHandlerTest extends TestCase
{
use RefreshDatabase;
public function test_temp_button_feedback_should_be_defined_before_copy_run_id_handler(): void
{
$js = file_get_contents(public_path('js/admin.js'));
$this->assertIsString($js);
$posTemp = strpos($js, 'function tempButtonFeedback');
$posRunId = strpos($js, 'copy-run-id');
$this->assertNotFalse($posTemp);
$this->assertNotFalse($posRunId);
$this->assertTrue($posTemp < $posRunId, 'tempButtonFeedback should be defined before copy-run-id handler');
}
}