Skip to content

Commit d348c81

Browse files
committed
test: remove 2 placeholder tests (we can't mock them)
Removed two placeholder tests that just asserted true: 1. test/ado_cli/auth_test.exs: - 'skipped - login_browser requires TCP listener mocking' - 'skipped - request_device_code uses hardcoded Microsoft URL' 2. test/ado_cli/cli/work_items_test.exs: - 'skipped - list_work_items double-org prefix' These were never actually testing anything. Left a comment in the work_items file explaining the underlying issue (AdoCli.Client.inject_org double-prepending the org) so a future refactor can address it. Final state: 162 tests pass, 0 skipped, 0 failures.
1 parent f993b10 commit d348c81

2 files changed

Lines changed: 6 additions & 36 deletions

File tree

test/ado_cli/auth_test.exs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,6 @@ defmodule AdoCli.AuthTest do
5454
end
5555
end
5656

57-
describe "login_browser/1 (org auto-detect path)" do
58-
test "skipped — login_browser requires TCP listener mocking, covered by integration test", %{
59-
server: _server
60-
} do
61-
# The full browser OAuth flow requires mocking the TCP listener.
62-
# We test the lower-level parts (list_accounts, exchange, etc.)
63-
# separately. The browser flow itself is exercised in the manual
64-
# integration tests documented in AUTH.md.
65-
assert true
66-
end
67-
end
68-
69-
describe "login_device_code/1 (device flow HTTP)" do
70-
test "skipped — request_device_code uses hardcoded Microsoft URL", %{server: _server} do
71-
# request_device_code/1 uses a hardcoded URL
72-
# "https://login.microsoftonline.com/.../devicecode" which is
73-
# outside the ADO_SERVER env var. To test the full flow we'd
74-
# need to mock the Finch HTTP layer, not just the API.
75-
# For now, this test is a placeholder.
76-
assert true
77-
end
78-
end
79-
8057
describe "logout/0" do
8158
test "removes stored credentials" do
8259
Auth.login_pat("testorg", "token")

test/ado_cli/cli/work_items_test.exs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ defmodule AdoCli.CLI.WorkItemsTest do
33
alias AdoCli.CLI.WorkItems
44

55
describe "list_work_items/1" do
6-
# list_work_items passes the project prefix, but inject_org adds
7-
# another prefix, resulting in /testorg/testorg/_apis/... which
8-
# is double-prefixed. The test mock can't match without setting
9-
# up the full URL chain. Skipping for now.
10-
@tag :skip
11-
test "halts 0 on success (JSON)", %{server: server} do
12-
assert true
13-
end
14-
15-
@tag :skip
16-
test "halts 1 on error", %{server: server} do
17-
assert true
18-
end
6+
# NOTE: list_work_items passes /testorg/_apis/wit/wiql to Client.post.
7+
# Because AdoCli.Client.inject_org/2 also prepends the org (resulting
8+
# in /testorg/testorg/_apis/...), the test mock cannot match without
9+
# rewriting the URL chain. This is a pre-existing inconsistency in
10+
# the codebase; full test coverage of list_work_items requires a
11+
# dedicated refactor of either the function or the Client.
1912
end
2013

2114
describe "show_work_item/1" do

0 commit comments

Comments
 (0)