mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-29 01:54:37 +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
941 B
PHP
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']],
|
|
]);
|