ui(plans): disable-on-submit for plan create/edit form

This commit is contained in:
萝卜
2026-03-17 06:01:37 +08:00
parent 7ef51da64f
commit 8efa67bf3c
2 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlanFormShouldDisableOnSubmitTest 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_plan_create_form_should_disable_on_submit(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/plans/create');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-action="disable-on-submit"', $html);
$this->assertStringContainsString('保存套餐', $html);
}
}