mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-28 17:44:36 +08: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>
26 lines
1.1 KiB
PHP
26 lines
1.1 KiB
PHP
<?php
|
|
|
|
use App\Livewire\Storage\Create;
|
|
use Tests\TestCase;
|
|
|
|
uses(TestCase::class);
|
|
|
|
it('gates the S3 storage edit form behind the update permission', function () {
|
|
$editView = file_get_contents(resource_path('views/livewire/storage/form.blade.php'));
|
|
|
|
expect($editView)->toContain('@can(\'update\', $storage)');
|
|
});
|
|
|
|
it('normalizes endpoints again on the backend', function (string $endpoint, string $expected) {
|
|
$method = new ReflectionMethod(Create::class, 'normalizeEndpoint');
|
|
|
|
expect($method->invoke(new Create, $endpoint))->toBe($expected);
|
|
})->with([
|
|
'missing scheme' => ['s3.example.com', 'https://s3.example.com'],
|
|
'existing HTTP scheme' => ['http://192.168.1.50:9000', 'http://192.168.1.50:9000'],
|
|
'malformed HTTP scheme' => ['http:/192.168.1.50:9000', 'http:/192.168.1.50:9000'],
|
|
'hostname with port' => ['minio.internal:9000', 'https://minio.internal:9000'],
|
|
'unsupported scheme' => ['ftp://s3.example.com', 'ftp://s3.example.com'],
|
|
'DigitalOcean bucket endpoint' => ['https://bucket.nyc3.digitaloceanspaces.com', 'https://nyc3.digitaloceanspaces.com'],
|
|
]);
|