mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-29 10:04: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>
38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Livewire\Dev\LivewireRequestFailurePreview;
|
|
use App\Models\InstanceSettings;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Livewire\Livewire;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function () {
|
|
config()->set('app.maintenance.store', 'array');
|
|
InstanceSettings::forceCreate(['id' => 0]);
|
|
});
|
|
|
|
it('registers the Livewire request failure preview in testing', function () {
|
|
expect(Route::has('dev.livewire-request-failure-preview'))->toBeTrue();
|
|
|
|
$this->get('/__livewire-request-failure')
|
|
->assertSuccessful()
|
|
->assertSee('Livewire request failure preview')
|
|
->assertSee('Gateway timeout')
|
|
->assertSee('504');
|
|
});
|
|
|
|
it('returns proxy-style html for supported statuses', function () {
|
|
Livewire::test(LivewireRequestFailurePreview::class)
|
|
->call('fail', 504)
|
|
->assertStatus(504)
|
|
->assertContent('<!doctype html><html><body><h1>Gateway time-out</h1><p>cloudflare proxy error 504</p></body></html>');
|
|
});
|
|
|
|
it('rejects statuses outside the supported list', function () {
|
|
Livewire::test(LivewireRequestFailurePreview::class)
|
|
->call('fail', 500)
|
|
->assertStatus(404);
|
|
});
|