mirror of
https://github.com/coollabsio/coolify.git
synced 2026-06-14 03:19:51 +00:00
d892d0ad10
Dispatch server show refreshes after Sentinel and metrics toggles, preserve editable Sentinel form fields during restart events, and gate custom image editing by update permission.
22 lines
861 B
PHP
22 lines
861 B
PHP
<?php
|
|
|
|
it('keeps sentinel restarted events from re-syncing editable form fields', function () {
|
|
$componentSource = file_get_contents(app_path('Livewire/Server/Sentinel.php'));
|
|
|
|
preg_match('/public function handleSentinelRestarted\([^)]*\)\s*\{(?<body>.*?)\n \}/s', $componentSource, $matches);
|
|
|
|
expect($matches['body'] ?? '')
|
|
->toContain('$this->sentinelUpdatedAt = $this->server->sentinel_updated_at;')
|
|
->not->toContain('$this->syncData();');
|
|
});
|
|
|
|
it('dispatches a server navbar refresh after toggling sentinel', function () {
|
|
$componentSource = file_get_contents(app_path('Livewire/Server/Sentinel.php'));
|
|
|
|
preg_match('/public function toggleSentinel\([^)]*\).*?\{(?<body>.*?)
|
|
\}/s', $componentSource, $matches);
|
|
|
|
expect($matches['body'] ?? '')
|
|
->toContain("\$this->dispatch('refreshServerShow');");
|
|
});
|