diff --git a/app/Livewire/Server/Sentinel.php b/app/Livewire/Server/Sentinel.php index cd05002aa..a69eb3f80 100644 --- a/app/Livewire/Server/Sentinel.php +++ b/app/Livewire/Server/Sentinel.php @@ -146,7 +146,7 @@ public function submit() { try { $this->syncData(true); - $this->dispatch('success', 'Sentinel settings updated.'); + $this->dispatch('success', 'Sentinel settings updated. Restarting Sentinel.'); } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/tests/Feature/Livewire/SentinelComponentTest.php b/tests/Feature/Livewire/SentinelComponentTest.php index 41b3f2b49..01250910a 100644 --- a/tests/Feature/Livewire/SentinelComponentTest.php +++ b/tests/Feature/Livewire/SentinelComponentTest.php @@ -36,3 +36,12 @@ expect($view)->not->toContain("? 'Disabled'"); }); + +it('tells the user that saving sentinel settings initiates a restart', function () { + $componentSource = file_get_contents(app_path('Livewire/Server/Sentinel.php')); + + preg_match('/public function submit\([^)]*\).*?\{(?.*?)\n \}/s', $componentSource, $matches); + + expect($matches['body'] ?? '') + ->toContain("\$this->dispatch('success', 'Sentinel settings updated. Restarting Sentinel.');"); +});