fix(sentinel): clarify restart after settings update
Add a regression test for the updated success notification.
This commit is contained in:
parent
ee843b7230
commit
1073bbca83
2 changed files with 10 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.');");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue