mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-13 16:23:37 -04:00
feat(metrics): add reachable /metrics fleet page skeleton
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use App\Livewire\Fleet\Metrics;
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Models\Team;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Livewire\Livewire;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
InstanceSettings::unguarded(fn () => InstanceSettings::query()->create(['id' => 0]));
|
||||
$user = User::factory()->create();
|
||||
$team = Team::factory()->create();
|
||||
$user->teams()->attach($team, ['role' => 'owner']);
|
||||
$this->actingAs($user);
|
||||
session(['currentTeam' => $team]);
|
||||
$this->team = $team;
|
||||
});
|
||||
|
||||
it('renders the metrics page with an empty state when no server has metrics enabled', function () {
|
||||
$component = loadLazy(Livewire::test(Metrics::class));
|
||||
|
||||
$component
|
||||
->assertOk()
|
||||
->assertSee('Metrics')
|
||||
->assertSee('Enable metrics on a server');
|
||||
});
|
||||
|
||||
it('registers the metrics route', function () {
|
||||
expect(route('metrics'))->toEndWith('/metrics');
|
||||
});
|
||||
Reference in New Issue
Block a user