fix(sentinel): clarify restart after settings update

Add a regression test for the updated success notification.
This commit is contained in:
Andras Bacsai 2026-08-18 15:06:05 +02:00
parent ee843b7230
commit 1073bbca83
2 changed files with 10 additions and 1 deletions

View file

@ -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);
}

View file

@ -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\([^)]*\).*?\{(?<body>.*?)\n \}/s', $componentSource, $matches);
expect($matches['body'] ?? '')
->toContain("\$this->dispatch('success', 'Sentinel settings updated. Restarting Sentinel.');");
});