diff --git a/resources/views/admin/plans/form.blade.php b/resources/views/admin/plans/form.blade.php index 7fae812..dc40445 100644 --- a/resources/views/admin/plans/form.blade.php +++ b/resources/views/admin/plans/form.blade.php @@ -13,7 +13,7 @@ -
+ @csrf @php diff --git a/tests/Feature/AdminPlanFormShouldDisableOnSubmitTest.php b/tests/Feature/AdminPlanFormShouldDisableOnSubmitTest.php new file mode 100644 index 0000000..640d171 --- /dev/null +++ b/tests/Feature/AdminPlanFormShouldDisableOnSubmitTest.php @@ -0,0 +1,34 @@ +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); + } +}