feat(admin): 重复批量投递warning提供复制run_id按钮(复用copyToClipboard)
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminFlashWarningShouldSupportCopyTextButtonTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function loginAsPlatformAdmin(): void
|
||||
{
|
||||
$this->seed();
|
||||
|
||||
$this->post('/admin/login', [
|
||||
'email' => 'platform.admin@demo.local',
|
||||
'password' => 'Platform@123456',
|
||||
])->assertRedirect('/admin');
|
||||
}
|
||||
|
||||
public function test_flash_warning_should_render_copy_text_button_when_session_keys_present(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->withSession([
|
||||
'warning' => '重复提交',
|
||||
'warning_link_href' => '/admin/platform-batches/show?type=bas&run_id=BAS202603171234560001',
|
||||
'warning_link_label' => '进入上次批次复盘',
|
||||
'warning_copy_text' => 'BAS202603171234560001',
|
||||
'warning_copy_label' => '复制run_id',
|
||||
])->get('/admin');
|
||||
|
||||
$res->assertOk();
|
||||
$res->assertSee('复制run_id');
|
||||
$res->assertSee('data-action="copy-text"', false);
|
||||
$res->assertSee('data-copy-text="BAS202603171234560001"', false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user