Handle Dokploy project composes in widget
This commit is contained in:
@@ -40,6 +40,13 @@ class DokployPlatformHealthWidgetTest extends TestCase
|
||||
'branch' => 'main',
|
||||
],
|
||||
],
|
||||
'compose' => [
|
||||
[
|
||||
'composeId' => 'cmp_1',
|
||||
'name' => 'Main Compose',
|
||||
'composeStatus' => 'done',
|
||||
],
|
||||
],
|
||||
'redis' => [
|
||||
[
|
||||
'redisId' => 'redis_1',
|
||||
@@ -63,12 +70,37 @@ class DokployPlatformHealthWidgetTest extends TestCase
|
||||
],
|
||||
]);
|
||||
|
||||
$fakeClient->shouldReceive('composeStatus')
|
||||
->with('cmp_1')
|
||||
->andReturn([
|
||||
'compose' => [
|
||||
'name' => 'Main Compose',
|
||||
'composeStatus' => 'done',
|
||||
'updatedAt' => now()->toIso8601String(),
|
||||
],
|
||||
'services' => [
|
||||
[
|
||||
'serviceName' => 'web',
|
||||
'status' => 'running',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$fakeClient->shouldReceive('composeDeployments')
|
||||
->with('cmp_1', 1)
|
||||
->andReturn([
|
||||
[
|
||||
'createdAt' => now()->toIso8601String(),
|
||||
],
|
||||
]);
|
||||
|
||||
$this->app->instance(DokployClient::class, $fakeClient);
|
||||
|
||||
Livewire::test(DokployPlatformHealth::class)
|
||||
->assertStatus(200)
|
||||
->assertSee('Core')
|
||||
->assertSee('API')
|
||||
->assertSee('Main Compose')
|
||||
->assertSee('Redis');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user