Skip to content

Commit c1c8acb

Browse files
committed
Fix tests
1 parent 0eeb3e3 commit c1c8acb

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/eca/llm_providers/copilot.clj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[eca.client-http :as client]
55
[eca.config :as config]
66
[eca.features.login :as f.login]
7+
[eca.shared :refer [multi-str]]
78
[hato.client :as http]))
89

910
(def ^:private client-id "Iv1.b507a08c87ecfe98")
@@ -71,10 +72,11 @@
7172
(swap! db* assoc-in [:chats chat-id :login-provider] provider)
7273
(swap! db* assoc-in [:auth provider] {:step :login/waiting-user-confirmation
7374
:device-code device-code})
74-
(send-msg! "First, make sure you have Copilot enabled in you Github account: https://github.com/settings/copilot/features")
75-
(send-msg! (format "\nThen, open your browser at:\n\n%s\n\nAuthenticate using the code: `%s`\nThen type anything in the chat and send it to continue the authentication."
76-
url
77-
user-code))))
75+
(send-msg! (multi-str
76+
"First, make sure you have Copilot enabled in you Github account: https://github.com/settings/copilot/features"
77+
(format "Then, open your browser at:\n\n%s\n\nAuthenticate using the code: `%s`\nThen type anything in the chat and send it to continue the authentication."
78+
url
79+
user-code)))))
7880

7981
(defmethod f.login/login-step ["github-copilot" :login/waiting-user-confirmation] [{:keys [db* provider send-msg!] :as ctx}]
8082
(let [access-token (oauth-access-token (get-in @db* [:auth provider :device-code]))

test/eca/features/login_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
(testing "should proceed to the next step"
5858
(println @msg-log)
59-
(is (re-find #"(?m)Open your browser at:\n\nhttps://mock.github.com/login/device\n\nAuthenticate using the code: `.+`\nThen type anything in the chat and send it to continue the authentication."
59+
(is (re-find #"(?m)Then, open your browser at:\n\nhttps://mock.github.com/login/device\n\nAuthenticate using the code: `.+`\nThen type anything in the chat and send it to continue the authentication."
6060
(last @msg-log)))
6161

6262
(testing "state is update to reflect in-progress login"

0 commit comments

Comments
 (0)