mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
fix(logs): wrap viewer in a root element for parent re-renders
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<div>
|
||||
@if (! $canReadLogs)
|
||||
<x-callout type="info" title="Hidden (only admins can view)">
|
||||
Container logs can contain secrets.
|
||||
@@ -315,3 +316,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -136,3 +136,16 @@ it('shows task commands and task output to an owner in the ui', function () {
|
||||
Livewire::test(GetLogs::class, ['server' => $this->server, 'resource' => $this->application, 'container' => 'app-container'])
|
||||
->assertDontSee('Hidden (only admins can view)');
|
||||
});
|
||||
|
||||
it('renders logs inside one root element so the parent can re-render it', function (string $role) {
|
||||
$this->actingAs($role === 'owner' ? $this->owner : $this->member);
|
||||
session(['currentTeam' => $this->team]);
|
||||
|
||||
$html = Livewire::test(GetLogs::class, ['server' => $this->server, 'resource' => $this->application, 'container' => 'app-container'])
|
||||
->html();
|
||||
|
||||
// Livewire reuses the first tag name as the placeholder for kept children; a leading comment gives an empty tag.
|
||||
preg_match('/<([a-zA-Z0-9\-]*)/', $html, $matches);
|
||||
|
||||
expect($matches[1])->toBe('div');
|
||||
})->with(['owner', 'member']);
|
||||
|
||||
Reference in New Issue
Block a user