ui(plans): disable-on-submit for plan create/edit form
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="{{ $formAction }}" class="card form-grid">
|
||||
<form method="post" action="{{ $formAction }}" class="card form-grid" data-action="disable-on-submit">
|
||||
@csrf
|
||||
|
||||
@php
|
||||
|
||||
34
tests/Feature/AdminPlanFormShouldDisableOnSubmitTest.php
Normal file
34
tests/Feature/AdminPlanFormShouldDisableOnSubmitTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user