mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-29 01:54:37 +08:00
Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Co-authored-by: Aditya Tripathi <aditya@climactic.co> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.3 KiB
PHP
33 lines
1.3 KiB
PHP
<?php
|
|
|
|
use App\Livewire\Storage\Create;
|
|
use Livewire\Livewire;
|
|
|
|
it('formats the internal target settings route as a clickable link', function () {
|
|
$settingsUrl = route('settings.advanced').'#endpoint-section';
|
|
$exception = new RuntimeException("Private target. Configure allowed internal targets: {$settingsUrl}");
|
|
$method = new ReflectionMethod(Create::class, 'connectionErrorDescription');
|
|
|
|
$description = $method->invoke(new Create, $exception);
|
|
|
|
expect($description)
|
|
->toContain('href="'.$settingsUrl.'"')
|
|
->toContain('Set them here.')
|
|
->not->toContain('targets: '.$settingsUrl);
|
|
});
|
|
|
|
it('turns path-style URLs off when the endpoint belongs to a provider that rejects them', function () {
|
|
Livewire::test(Create::class)
|
|
->set('endpointParts.host', 's3.oss-ap-southeast-1.aliyuncs.com')
|
|
->assertSet('usePathStyleEndpoint', false)
|
|
->set('endpointParts.host', 'minio.internal')
|
|
->assertSet('usePathStyleEndpoint', true);
|
|
});
|
|
|
|
it('keeps the URL style that the user selected when the endpoint changes', function () {
|
|
Livewire::test(Create::class)
|
|
->set('usePathStyleEndpoint', true)
|
|
->set('endpointParts.host', 's3.oss-ap-southeast-1.aliyuncs.com')
|
|
->assertSet('usePathStyleEndpoint', true);
|
|
});
|