Skip to content

Commit 4d0de63

Browse files
test urls
1 parent 0ab7552 commit 4d0de63

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

index.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,12 @@ TEST: addTests('isDashboard', [
7070
'https://github.com//',
7171
'https://github.com/',
7272
'https://github.com',
73-
'https://github.com/orgs/test/dashboard',
73+
'https://github.com/orgs/refined-github/dashboard',
7474
'https://github.com/dashboard/index/2',
7575
'https://github.com//dashboard',
7676
'https://github.com/dashboard',
77-
'https://github.com/orgs/edit/dashboard',
78-
'https://github.big-corp.com/',
79-
'https://not-github.com/',
80-
'https://my-little-hub.com/',
77+
'https://ghe.big-corp.com/',
78+
'https://ghe-instance.com/',
8179
'https://github.com/?tab=repositories', // Gotcha for `isUserProfileRepoTab`
8280
'https://github.com/?tab=stars', // Gotcha for `isUserProfileStarsTab`
8381
'https://github.com/?tab=followers', // Gotcha for `isUserProfileFollowersTab`
@@ -90,7 +88,19 @@ TEST: addTests('isDashboard', [
9088
export const isHome = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^dashboard\/?$/.test(getCleanPathname(url));
9189
TEST: addTests('isHome', [
9290
'https://github.com',
91+
'https://github.com///',
92+
'https://github.com//',
93+
'https://github.com/',
94+
'https://github.com//dashboard',
9395
'https://github.com/dashboard',
96+
'https://ghe.big-corp.com/',
97+
'https://ghe-instance.com/',
98+
'https://github.com/?tab=repositories', // Gotcha for `isUserProfileRepoTab`
99+
'https://github.com/?tab=stars', // Gotcha for `isUserProfileStarsTab`
100+
'https://github.com/?tab=followers', // Gotcha for `isUserProfileFollowersTab`
101+
'https://github.com/?tab=following', // Gotcha for `isUserProfileFollowingTab`
102+
'https://github.com/?tab=overview', // Gotcha for `isUserProfileMainTab`
103+
'https://github.com?search=1', // Gotcha for `isRepoTree`
94104
]);
95105

96106
export const isFeed = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^(feed|orgs\/[^/]+\/dashboard)\/?$/.test(getCleanPathname(url));

0 commit comments

Comments
 (0)