mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Furox <177975472+Furox-Art@users.noreply.github.com> Co-authored-by: johandenhollander <johan.den.hollander@finalist.nl> Co-authored-by: João Cruz <161638790+SrJooJ@users.noreply.github.com> Co-authored-by: Saim Hashmi <hashmisaim037@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
43 lines
1.6 KiB
PHP
43 lines
1.6 KiB
PHP
<?php
|
|
|
|
use App\Livewire\Project\New\PublicGitRepository;
|
|
use App\Models\Team;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Livewire\Livewire;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function () {
|
|
$team = Team::factory()->create();
|
|
$user = User::factory()->create();
|
|
$team->members()->attach($user->id, ['role' => 'owner']);
|
|
|
|
$this->actingAs($user);
|
|
session(['currentTeam' => $team]);
|
|
});
|
|
|
|
test('converts scp-style ssh urls with custom usernames to https', function () {
|
|
Livewire::test(PublicGitRepository::class, ['type' => 'public'])
|
|
->set('repository_url', 'custom-user@git.example.com:organization/repository.git')
|
|
->call('loadBranch')
|
|
->assertSet('repository_url', 'https://git.example.com/organization/repository.git')
|
|
->assertSet('branchFound', true);
|
|
});
|
|
|
|
test('strips custom ports when converting scp-style ssh urls to https', function () {
|
|
Livewire::test(PublicGitRepository::class, ['type' => 'public'])
|
|
->set('repository_url', 'custom-user@git.example.com:2222/organization/repository.git')
|
|
->call('loadBranch')
|
|
->assertSet('repository_url', 'https://git.example.com/organization/repository.git')
|
|
->assertSet('branchFound', true);
|
|
});
|
|
|
|
test('converts ssh scheme urls with custom ports to https', function () {
|
|
Livewire::test(PublicGitRepository::class, ['type' => 'public'])
|
|
->set('repository_url', 'ssh://git@gitea.example.com:2222/organization/repository.git')
|
|
->call('loadBranch')
|
|
->assertSet('repository_url', 'https://gitea.example.com/organization/repository.git')
|
|
->assertSet('branchFound', true);
|
|
});
|