@@ -5,6 +5,12 @@ const exists = (selector: string) => Boolean(document.querySelector(selector));
5
5
6
6
const combinedTestOnly = 'combinedTestOnly' ; // To be used only to skip tests of combined functions, i.e. isPageA() || isPageB()
7
7
8
+ collect . set ( '__urls_that_dont_match__' , [
9
+ 'https://github.com/sindresorhus/refined-github/issues/new' ,
10
+ 'https://github.com/sindresorhus/refined-github/issues/new/choose' ,
11
+ 'https://github.com/sindresorhus/refined-github/issues/templates/edit' ,
12
+ ] ) ;
13
+
8
14
export const is404 = ( ) : boolean => document . title === 'Page not found · GitHub' ;
9
15
10
16
export const is500 = ( ) : boolean => document . title === 'Server Error · GitHub' || document . title === 'Unicorn! · GitHub' || document . title === '504 Gateway Time-out' ;
@@ -115,6 +121,7 @@ collect.set('isConversation', combinedTestOnly);
115
121
export const isLabelList = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'labels' ;
116
122
collect . set ( 'isLabelList' , [
117
123
'https://github.com/sindresorhus/refined-github/labels' ,
124
+ 'https://github.com/sindresorhus/refined-github/labels/' ,
118
125
] ) ;
119
126
120
127
export const isMilestone = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ m i l e s t o n e \/ \d + / . test ( getRepo ( url ) ?. path ! ) ;
@@ -283,7 +290,9 @@ export const isEmptyRepo = (): boolean => exists('[aria-label="Cannot fork becau
283
290
284
291
export const isRepoTaxonomyConversationList = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ l a b e l s \/ .+ | ^ m i l e s t o n e s \/ \d + (? ! \/ e d i t ) / . test ( getRepo ( url ) ?. path ! ) ;
285
292
collect . set ( 'isRepoTaxonomyConversationList' , [
286
- 'https://github.com/sindresorhus/refined-github/labels/Priority%3A%20critical' ,
293
+ 'https://github.com/sindresorhus/refined-github/labels/bug' ,
294
+ 'https://github.com/sindresorhus/refined-github/labels/implemented%20by%20github' ,
295
+ 'https://github.com/sindresorhus/refined-github/labels/%3Adollar%3A%20Funded%20on%20Issuehunt' ,
287
296
'https://github.com/sindresorhus/refined-github/milestones/1' ,
288
297
] ) ;
289
298
@@ -301,17 +310,19 @@ collect.set('isRepoPRList', [
301
310
'https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed' ,
302
311
] ) ;
303
312
304
- // `issues/fregante` is a list but `issues/1`, `issues/new`, `issues/new/choose`, `issues/templates/edit` aren’t
305
313
export const isRepoIssueList = ( url : URL | HTMLAnchorElement | Location = location ) : boolean =>
306
- Boolean ( getRepo ( url ) ?. path . startsWith ( ' issues' ) ) &&
307
- ! / ^ i s s u e s \/ ( \d + | n e w | t e m p l a t e s ) ( $ | \/ ) / . test ( getRepo ( url ) ?. path ! ) ;
314
+ // ` issues/fregante` is a list but `issues/1`, `issues/new`, `issues/new/choose`, `issues/templates/edit` aren’t
315
+ / ^ l a b e l s \/ | ^ i s s u e s (? ! \/ ( \d + | n e w | t e m p l a t e s ) ( $ | \/ ) ) / . test ( getRepo ( url ) ?. path ! ) ;
308
316
collect . set ( 'isRepoIssueList' , [
309
317
'http://github.com/sindresorhus/ava/issues' ,
310
318
'https://github.com/sindresorhus/refined-github/issues' ,
311
319
'https://github.com/sindresorhus/refined-github/issues/fregante' ,
312
320
'https://github.com/sindresorhus/refined-github/issues/newton' ,
313
321
'https://github.com/sindresorhus/refined-github/issues/wptemplates' ,
314
322
'https://github.com/sindresorhus/refined-github/issues?q=is%3Aclosed+sort%3Aupdated-desc' ,
323
+ 'https://github.com/sindresorhus/refined-github/labels/bug' ,
324
+ 'https://github.com/sindresorhus/refined-github/labels/implemented%20by%20github' ,
325
+ 'https://github.com/sindresorhus/refined-github/labels/%3Adollar%3A%20Funded%20on%20Issuehunt' ,
315
326
] ) ;
316
327
317
328
export const isRepoHome = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === '' ;
0 commit comments