From f8eb6f725e863f9f5075188051f89104cb95ab34 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 15 Oct 2026 22:49:07 +0200 Subject: [PATCH] test(source): cover deleting an incomplete github app Closes #12017 --- .../Application/GithubSourceChangeTest.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/Feature/Application/GithubSourceChangeTest.php b/tests/Feature/Application/GithubSourceChangeTest.php index c3912ead7d..c42139c396 100644 --- a/tests/Feature/Application/GithubSourceChangeTest.php +++ b/tests/Feature/Application/GithubSourceChangeTest.php @@ -62,6 +62,30 @@ describe('GitHub Source Change Component', function () { expect($missingAuthorization)->toBeEmpty(); }); + test('deletes an incomplete github app and redirects without a render error', function () { + $githubApp = GithubApp::create([ + 'name' => 'Incomplete GitHub App', + 'organization' => 'coollabsio', + 'api_url' => 'https://api.github.com', + 'html_url' => 'https://github.com', + 'custom_user' => 'git', + 'custom_port' => 22, + 'team_id' => $this->team->id, + 'is_system_wide' => false, + ]); + + Livewire::withQueryParams(['github_app_uuid' => $githubApp->uuid]) + ->test(Change::class) + ->assertSee('Incomplete GitHub App') + ->call('delete') + ->assertHasNoErrors() + ->assertRedirect(route('source.all')) + ->assertSet('github_app', null) + ->call('$refresh'); + + expect(GithubApp::find($githubApp->id))->toBeNull(); + }); + test('can mount with newly created github app with null app_id', function () { // Create a GitHub app without app_id (simulating a newly created source) $githubApp = GithubApp::create([