Files
coolify/tests/Feature/ProjectAndEnvironmentSettingsButtonTest.php
T
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

58 lines
1.8 KiB
PHP

<?php
use App\Livewire\Project\Show as ProjectShow;
use App\Models\InstanceSettings;
use App\Models\Project;
use App\Models\Team;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Queue;
use Livewire\Livewire;
uses(RefreshDatabase::class);
beforeEach(function () {
Queue::fake();
InstanceSettings::unguarded(fn () => InstanceSettings::query()->create(['id' => 0]));
$this->user = User::factory()->create();
$this->team = Team::factory()->create();
$this->user->teams()->attach($this->team, ['role' => 'owner']);
$this->actingAs($this->user);
session(['currentTeam' => $this->team]);
$this->project = Project::factory()->create([
'team_id' => $this->team->id,
'name' => 'Test Project',
]);
$this->environment = $this->project->environments()->firstOrFail();
});
test('project show page header links to project settings', function () {
$editUrl = route('project.edit', ['project_uuid' => $this->project->uuid]);
Livewire::test(ProjectShow::class, ['project_uuid' => $this->project->uuid])
->assertSee('Settings')
->assertSee('Project settings', false)
->assertSeeHtml($editUrl);
});
test('environment resources page header links to environment settings', function () {
$editUrl = route('project.environment.edit', [
'project_uuid' => $this->project->uuid,
'environment_uuid' => $this->environment->uuid,
]);
$this->get(route('project.resource.index', [
'project_uuid' => $this->project->uuid,
'environment_uuid' => $this->environment->uuid,
]))
->assertSuccessful()
->assertSee('Settings')
->assertSee('Environment settings', false)
->assertSee($editUrl, false);
});