@@ -201,13 +201,37 @@ describe("getDesktopUpdateActionError", () => {
201201
202202describe ( "desktop update UI helpers" , ( ) => {
203203 it ( "builds the stable release URL for a downloaded version" , ( ) => {
204- expect ( getDesktopUpdateReleaseUrl ( "0.0.30" ) ) . toBe (
204+ expect ( getDesktopUpdateReleaseUrl ( "0.0.30" , "pingdotgg/t3code" ) ) . toBe (
205205 "https://github.com/pingdotgg/t3code/releases/tag/v0.0.30" ,
206206 ) ;
207207 } ) ;
208208
209+ it ( "uses the configured desktop update repository for release URLs" , ( ) => {
210+ expect ( getDesktopUpdateReleaseUrl ( "1.2.3" , "JustYannicc/t3code" ) ) . toBe (
211+ "https://github.com/JustYannicc/t3code/releases/tag/v1.2.3" ,
212+ ) ;
213+ expect ( getDesktopUpdateReleaseHistoryUrl ( "JustYannicc/t3code" ) ) . toBe (
214+ "https://github.com/JustYannicc/t3code/releases" ,
215+ ) ;
216+ } ) ;
217+
218+ it . each ( [
219+ "owner/repo/extra" ,
220+ "owner#notes/repo" ,
221+ "owner/repo#notes" ,
222+ "owner?tab=notes/repo" ,
223+ "owner/repo?tab=notes" ,
224+ ] ) ( "falls back to upstream for an invalid configured repository: %s" , ( repository ) => {
225+ expect ( getDesktopUpdateReleaseHistoryUrl ( repository ) ) . toBe (
226+ "https://github.com/pingdotgg/t3code/releases" ,
227+ ) ;
228+ expect ( getDesktopUpdateReleaseUrl ( "1.2.3" , repository ) ) . toBe (
229+ "https://github.com/pingdotgg/t3code/releases/tag/v1.2.3" ,
230+ ) ;
231+ } ) ;
232+
209233 it ( "builds the nightly release URL without dropping its version suffix" , ( ) => {
210- expect ( getDesktopUpdateReleaseUrl ( "0.0.30-nightly.20260728.931" ) ) . toBe (
234+ expect ( getDesktopUpdateReleaseUrl ( "0.0.30-nightly.20260728.931" , "pingdotgg/t3code" ) ) . toBe (
211235 "https://github.com/pingdotgg/t3code/releases/tag/v0.0.30-nightly.20260728.931" ,
212236 ) ;
213237 } ) ;
@@ -218,7 +242,7 @@ describe("desktop update UI helpers", () => {
218242 } ) ;
219243
220244 it ( "builds the release history URL" , ( ) => {
221- expect ( getDesktopUpdateReleaseHistoryUrl ( ) ) . toBe (
245+ expect ( getDesktopUpdateReleaseHistoryUrl ( "pingdotgg/t3code" ) ) . toBe (
222246 "https://github.com/pingdotgg/t3code/releases" ,
223247 ) ;
224248 } ) ;
0 commit comments