Files
coolify/tests/Feature/SettingsOauthProviderControlsTest.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

26 lines
941 B
PHP

<?php
use App\Models\OauthSetting;
it('requires the provider-specific fields used by oauth enablement', function (string $provider, array $requiredFields) {
$complete = [
'provider' => $provider,
'client_id' => 'client-id',
'client_secret' => 'client-secret',
'tenant' => 'tenant-id',
'base_url' => 'https://auth.example.com',
];
expect((new OauthSetting($complete))->couldBeEnabled())->toBeTrue();
foreach ($requiredFields as $field) {
expect((new OauthSetting([...$complete, $field => null]))->couldBeEnabled())
->toBeFalse("{$provider} must require {$field}");
}
})->with([
'github' => ['github', ['client_id', 'client_secret']],
'azure' => ['azure', ['client_id', 'client_secret', 'tenant']],
'authentik' => ['authentik', ['client_id', 'client_secret', 'base_url']],
'clerk' => ['clerk', ['client_id', 'client_secret', 'base_url']],
]);