mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
- Delete Blade components, component classes, Livewire components and views that nothing uses after the redesign. - Delete tests that only compare Blade/CSS source text; keep the source checks for authorization gates, stable wire:key values and escaping. - Update stale tests to the current UI and behaviour. - Update DESIGN.md to the current navigation and layout. - Add a lesson: test behaviour, not source markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
1.8 KiB
PHP
66 lines
1.8 KiB
PHP
<?php
|
|
|
|
use App\Models\StandaloneClickhouse;
|
|
use Tests\TestCase;
|
|
|
|
uses(TestCase::class);
|
|
|
|
test('clickhouse uses clickhouse_db field in internal connection string', function () {
|
|
$clickhouse = new StandaloneClickhouse;
|
|
$clickhouse->clickhouse_admin_user = 'testuser';
|
|
$clickhouse->clickhouse_admin_password = 'testpass';
|
|
$clickhouse->clickhouse_db = 'mydb';
|
|
$clickhouse->uuid = 'test-uuid';
|
|
|
|
$internalUrl = $clickhouse->internal_db_url;
|
|
|
|
expect($internalUrl)
|
|
->toContain('mydb')
|
|
->toContain('testuser')
|
|
->toContain('test-uuid');
|
|
});
|
|
|
|
test('clickhouse defaults to default database when clickhouse_db is null', function () {
|
|
$clickhouse = new StandaloneClickhouse;
|
|
$clickhouse->clickhouse_admin_user = 'testuser';
|
|
$clickhouse->clickhouse_admin_password = 'testpass';
|
|
$clickhouse->clickhouse_db = null;
|
|
$clickhouse->uuid = 'test-uuid';
|
|
|
|
$internalUrl = $clickhouse->internal_db_url;
|
|
|
|
expect($internalUrl)->toContain('/default');
|
|
});
|
|
|
|
test('clickhouse external url uses correct database', function () {
|
|
$clickhouse = new StandaloneClickhouse;
|
|
$clickhouse->clickhouse_admin_user = 'admin';
|
|
$clickhouse->clickhouse_admin_password = 'secret';
|
|
$clickhouse->clickhouse_db = 'production';
|
|
$clickhouse->uuid = 'prod-uuid';
|
|
$clickhouse->is_public = true;
|
|
$clickhouse->public_port = 8123;
|
|
|
|
$clickhouse->destination = new class
|
|
{
|
|
public $server;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->server = new class
|
|
{
|
|
public function __get($name)
|
|
{
|
|
if ($name === 'getIp') {
|
|
return '1.2.3.4';
|
|
}
|
|
}
|
|
};
|
|
}
|
|
};
|
|
$externalUrl = $clickhouse->external_db_url;
|
|
|
|
expect($externalUrl)->toContain('production');
|
|
|
|
});
|