Skip to content

Commit a901224

Browse files
authored
feat(url): improve fallback url support (#2445)
* feat(url): improve fallback url handling Signed-off-by: Adam Setch <[email protected]> * feat(url): improve fallback url handling Signed-off-by: Adam Setch <[email protected]> * feat(url): improve fallback url handling Signed-off-by: Adam Setch <[email protected]> * feat(url): improve fallback url handling Signed-off-by: Adam Setch <[email protected]> * feat(url): improve fallback url handling Signed-off-by: Adam Setch <[email protected]> --------- Signed-off-by: Adam Setch <[email protected]>
1 parent df35341 commit a901224

File tree

4 files changed

+179
-156
lines changed

4 files changed

+179
-156
lines changed

src/renderer/utils/api/__mocks__/response-mocks.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -418,27 +418,26 @@ export const mockDiscussionLabels: DiscussionLabels = {
418418
],
419419
};
420420

421-
export const mockGraphQLResponse: GraphQLSearch<Discussion> = {
421+
export const mockDiscussion: Discussion = {
422+
number: 123,
423+
title: '1.16.0',
424+
isAnswered: false,
425+
stateReason: 'OPEN',
426+
url: 'https://github.com/gitify-app/notifications-test/discussions/612' as Link,
427+
author: {
428+
login: 'discussion-creator',
429+
url: 'https://github.com/discussion-creator' as Link,
430+
avatar_url: 'https://avatars.githubusercontent.com/u/123456789?v=4' as Link,
431+
type: 'User',
432+
},
433+
comments: mockDiscussionComments,
434+
labels: mockDiscussionLabels,
435+
};
436+
437+
export const mockSearchDiscussionsGraphQLResponse: GraphQLSearch<Discussion> = {
422438
data: {
423439
search: {
424-
nodes: [
425-
{
426-
number: 123,
427-
title: '1.16.0',
428-
isAnswered: false,
429-
stateReason: 'OPEN',
430-
url: 'https://github.com/gitify-app/notifications-test/discussions/612' as Link,
431-
author: {
432-
login: 'discussion-creator',
433-
url: 'https://github.com/discussion-creator' as Link,
434-
avatar_url:
435-
'https://avatars.githubusercontent.com/u/123456789?v=4' as Link,
436-
type: 'User',
437-
},
438-
comments: mockDiscussionComments,
439-
labels: mockDiscussionLabels,
440-
},
441-
],
440+
nodes: [mockDiscussion],
442441
},
443442
},
444443
};

src/renderer/utils/api/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,6 @@ export async function getLatestDiscussion(
284284
notification,
285285
);
286286
}
287+
288+
return null;
287289
}

0 commit comments

Comments
 (0)