Skip to content

Commit 3877cb2

Browse files
committed
refactor: clean up unused aliases and improve GitHub mock functionality
- Removed unused aliases from the Bounties module and the BountiesLive module. - Enhanced the GitHub mock with new methods for deleting issue comments and listing labels, improving test coverage for GitHub interactions.
1 parent ed5f2b0 commit 3877cb2

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

lib/algora/bounties/bounties.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ defmodule Algora.Bounties do
1212
alias Algora.Bounties.Jobs
1313
alias Algora.Bounties.LineItem
1414
alias Algora.Bounties.Tip
15-
alias Algora.Github
1615
alias Algora.Organizations.Member
1716
alias Algora.Payments
1817
alias Algora.Payments.Transaction
1918
alias Algora.PSP
2019
alias Algora.Repo
2120
alias Algora.Util
2221
alias Algora.Workspace
23-
alias Algora.Workspace.CommandResponse
2422
alias Algora.Workspace.Installation
2523
alias Algora.Workspace.Ticket
2624

lib/algora_web/live/org/bounties_live.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ defmodule AlgoraWeb.Org.BountiesLive do
322322
<.drawer_content>
323323
<.form
324324
for={@edit_form}
325-
as="edit_amount"
326325
phx-submit="save-bounty-amount"
327326
phx-change="validate-amount"
328327
class="space-y-4"

test/support/github_mock.ex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ defmodule Algora.Support.GithubMock do
143143
{:ok, %{"id" => random_id()}}
144144
end
145145

146+
@impl true
147+
def delete_issue_comment(_access_token, _owner, _repo, _comment_id) do
148+
{:ok, %{"id" => random_id()}}
149+
end
150+
146151
@impl true
147152
def list_user_repositories(_access_token, _username, _opts \\ []) do
148153
{:ok, []}
@@ -173,6 +178,11 @@ defmodule Algora.Support.GithubMock do
173178
{:ok, []}
174179
end
175180

181+
@impl true
182+
def list_labels(_access_token, _owner, _repo, _number) do
183+
{:ok, []}
184+
end
185+
176186
@impl true
177187
def create_label(_access_token, _owner, _repo, _label) do
178188
{:ok, %{"id" => random_id()}}
@@ -187,4 +197,9 @@ defmodule Algora.Support.GithubMock do
187197
def remove_label(_access_token, _owner, _repo, _label) do
188198
{:ok, %{"id" => random_id()}}
189199
end
200+
201+
@impl true
202+
def remove_label_from_issue(_access_token, _owner, _repo, _number, _label) do
203+
{:ok, %{"id" => random_id()}}
204+
end
190205
end

0 commit comments

Comments
 (0)