Files
coolify/tests/Feature/StorageSettingsLayoutTest.php
Andras BacsaiandClaude Opus 5.5 a79ee909c6 chore: remove unused components and markup-only tests
- 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>
2026-09-28 00:18:16 +02:00

48 lines
1.3 KiB
PHP

<?php
use App\Models\InstanceSettings;
use App\Models\S3Storage;
use App\Models\Team;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
beforeEach(function () {
$this->team = Team::factory()->create();
$this->user = User::factory()->create();
$this->team->members()->attach($this->user->id, ['role' => 'owner']);
$this->actingAs($this->user);
session(['currentTeam' => $this->team]);
InstanceSettings::forceCreate([
'id' => 0,
'fqdn' => null,
'public_ipv4' => null,
'public_ipv6' => null,
]);
});
it('renders the danger zone page for a storage destination', function () {
$storage = S3Storage::create([
'uuid' => (string) str()->uuid(),
'name' => 'minio',
'description' => 'Local MinIO',
'endpoint' => 'http://minio:9000',
'bucket' => 'coolify',
'region' => 'us-east-1',
'key' => 'access',
'secret' => 'secret',
'team_id' => $this->team->id,
'is_usable' => true,
]);
$this->get(route('storage.danger', ['storage_uuid' => $storage->uuid]))
->assertOk()
->assertSee('Danger zone', false)
->assertSee('Delete storage', false)
->assertSee('Connected', false)
->assertDontSee('Validate connection', false);
});