Skip to content

Commit dd783be

Browse files
committed
feat(test): migrate from jest to vitest
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 8aa7011 commit dd783be

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/renderer/hooks/useNotifications.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
408408
apiClient,
409409
'listNotificationsForAuthenticatedUser',
410410
).mockResolvedValue(
411-
[] satisfies Partial<ListNotificationsForAuthenticatedUserResponse> as any,
411+
[] satisfies Partial<ListNotificationsForAuthenticatedUserResponse>,
412412
);
413413

414414
const stateWithBoth = {
@@ -441,7 +441,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
441441
describe('markNotificationsAsRead', () => {
442442
it('should mark notifications as read with success', async () => {
443443
vi.spyOn(apiClient, 'markNotificationThreadAsRead').mockResolvedValue(
444-
{} as any,
444+
undefined,
445445
);
446446

447447
const { result } = renderHook(() => useNotifications());
@@ -535,7 +535,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
535535
).mockResolvedValue(mockNotifications as any);
536536

537537
vi.spyOn(apiClient, 'markNotificationThreadAsRead').mockResolvedValue(
538-
{} as any,
538+
undefined,
539539
);
540540

541541
const stateWithFetchRead = {
@@ -647,7 +647,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
647647
.mockResolvedValueOnce(mockEnterpriseNotifications as any);
648648

649649
vi.spyOn(apiClient, 'markNotificationThreadAsRead').mockResolvedValue(
650-
{} as any,
650+
undefined,
651651
);
652652

653653
const stateWithMultipleAccounts = {
@@ -733,7 +733,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
733733
).mockResolvedValue(mockNotifications as any);
734734

735735
vi.spyOn(apiClient, 'markNotificationThreadAsRead').mockResolvedValue(
736-
{} as any,
736+
undefined,
737737
);
738738

739739
const stateWithFetchRead = {
@@ -787,7 +787,7 @@ describe('renderer/hooks/useNotifications.ts', () => {
787787
describe('markNotificationsAsDone', () => {
788788
it('should mark notifications as done with success', async () => {
789789
vi.spyOn(apiClient, 'markNotificationThreadAsDone').mockResolvedValue(
790-
{} as any,
790+
undefined,
791791
);
792792

793793
const { result } = renderHook(() => useNotifications());
@@ -853,10 +853,10 @@ describe('renderer/hooks/useNotifications.ts', () => {
853853
vi.spyOn(
854854
apiClient,
855855
'ignoreNotificationThreadSubscription',
856-
).mockResolvedValue({} as any);
856+
).mockResolvedValue(undefined);
857857

858858
vi.spyOn(apiClient, 'markNotificationThreadAsRead').mockResolvedValue(
859-
{} as any,
859+
undefined,
860860
);
861861

862862
const { result } = renderHook(() => useNotifications());
@@ -879,10 +879,10 @@ describe('renderer/hooks/useNotifications.ts', () => {
879879
vi.spyOn(
880880
apiClient,
881881
'ignoreNotificationThreadSubscription',
882-
).mockResolvedValue({} as any);
882+
).mockResolvedValue(undefined);
883883

884884
vi.spyOn(apiClient, 'markNotificationThreadAsDone').mockResolvedValue(
885-
{} as any,
885+
undefined,
886886
);
887887

888888
const { result } = renderHook(() => useNotifications());
@@ -938,10 +938,10 @@ describe('renderer/hooks/useNotifications.ts', () => {
938938
vi.spyOn(
939939
apiClient,
940940
'ignoreNotificationThreadSubscription',
941-
).mockResolvedValue({} as any);
941+
).mockResolvedValue(undefined);
942942

943943
vi.spyOn(apiClient, 'markNotificationThreadAsDone').mockResolvedValue(
944-
{} as any,
944+
undefined,
945945
);
946946

947947
const { result } = renderHook(() => useNotifications());
@@ -971,10 +971,10 @@ describe('renderer/hooks/useNotifications.ts', () => {
971971
vi.spyOn(
972972
apiClient,
973973
'ignoreNotificationThreadSubscription',
974-
).mockResolvedValue({} as any);
974+
).mockResolvedValue(undefined);
975975

976976
vi.spyOn(apiClient, 'markNotificationThreadAsRead').mockResolvedValue(
977-
{} as any,
977+
undefined,
978978
);
979979

980980
const { result } = renderHook(() => useNotifications());

src/renderer/utils/notifications/handlers/discussion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class DiscussionHandler extends DefaultHandler {
7474
labels:
7575
discussion.labels?.nodes.map((label) => ({
7676
name: label.name,
77-
color: (label as any).color,
77+
color: label.color,
7878
})) ?? [],
7979
htmlUrl: latestDiscussionComment?.url ?? discussion.url,
8080
reactionsCount: discussionReactionCount,

src/renderer/utils/notifications/handlers/issue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class IssueHandler extends DefaultHandler {
5757
labels:
5858
issue.labels?.nodes.map((label) => ({
5959
name: label.name,
60-
color: (label as any).color,
60+
color: label.color,
6161
})) ?? [],
6262
milestone: issue.milestone ?? undefined,
6363
htmlUrl: issueComment?.url ?? issue.url,

src/renderer/utils/notifications/handlers/pullRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class PullRequestHandler extends DefaultHandler {
6868
labels:
6969
pr.labels?.nodes.map((label) => ({
7070
name: label.name,
71-
color: (label as any).color,
71+
color: label.color,
7272
})) ?? [],
7373
linkedIssues: pr.closingIssuesReferences?.nodes.map((issue) =>
7474
formatGitHubNumber(issue.number),

0 commit comments

Comments
 (0)