1- import { createMockNotificationForRepoName } from '../../__mocks__/notifications-mocks' ;
1+ import { mockNotificationWithRepoName } from '../../__mocks__/notifications-mocks' ;
22import { mockSettings } from '../../__mocks__/state-mocks' ;
33import { GroupBy } from '../../types' ;
44import type { Notification } from '../../typesGitHub' ;
@@ -24,9 +24,9 @@ describe('renderer/utils/notifications/group.ts', () => {
2424 describe ( 'groupNotificationsByRepository' , ( ) => {
2525 it ( 'groups notifications by repository full_name' , ( ) => {
2626 const notifications : Notification [ ] = [
27- createMockNotificationForRepoName ( '1' , 'owner/repo-a' ) ,
28- createMockNotificationForRepoName ( '2' , 'owner/repo-b' ) ,
29- createMockNotificationForRepoName ( '3' , 'owner/repo-a' ) ,
27+ mockNotificationWithRepoName ( '1' , 'owner/repo-a' ) ,
28+ mockNotificationWithRepoName ( '2' , 'owner/repo-b' ) ,
29+ mockNotificationWithRepoName ( '3' , 'owner/repo-a' ) ,
3030 ] ;
3131
3232 const result = groupNotificationsByRepository ( notifications ) ;
@@ -38,10 +38,10 @@ describe('renderer/utils/notifications/group.ts', () => {
3838
3939 it ( 'preserves first-seen repository order' , ( ) => {
4040 const notifications : Notification [ ] = [
41- createMockNotificationForRepoName ( '1' , 'owner/repo-c' ) ,
42- createMockNotificationForRepoName ( '2' , 'owner/repo-a' ) ,
43- createMockNotificationForRepoName ( '3' , 'owner/repo-b' ) ,
44- createMockNotificationForRepoName ( '4' , 'owner/repo-a' ) ,
41+ mockNotificationWithRepoName ( '1' , 'owner/repo-c' ) ,
42+ mockNotificationWithRepoName ( '2' , 'owner/repo-a' ) ,
43+ mockNotificationWithRepoName ( '3' , 'owner/repo-b' ) ,
44+ mockNotificationWithRepoName ( '4' , 'owner/repo-a' ) ,
4545 ] ;
4646
4747 const result = groupNotificationsByRepository ( notifications ) ;
@@ -52,9 +52,9 @@ describe('renderer/utils/notifications/group.ts', () => {
5252
5353 it ( 'skips notifications without repository data' , ( ) => {
5454 const notifications : Notification [ ] = [
55- createMockNotificationForRepoName ( '1' , 'owner/repo-a' ) ,
56- createMockNotificationForRepoName ( '2' , null ) ,
57- createMockNotificationForRepoName ( '3' , 'owner/repo-a' ) ,
55+ mockNotificationWithRepoName ( '1' , 'owner/repo-a' ) ,
56+ mockNotificationWithRepoName ( '2' , null ) ,
57+ mockNotificationWithRepoName ( '3' , 'owner/repo-a' ) ,
5858 ] ;
5959
6060 const result = groupNotificationsByRepository ( notifications ) ;
@@ -73,8 +73,8 @@ describe('renderer/utils/notifications/group.ts', () => {
7373
7474 it ( 'returns empty map when all notifications lack repository data' , ( ) => {
7575 const notifications : Notification [ ] = [
76- createMockNotificationForRepoName ( '1' , null ) ,
77- createMockNotificationForRepoName ( '2' , null ) ,
76+ mockNotificationWithRepoName ( '1' , null ) ,
77+ mockNotificationWithRepoName ( '2' , null ) ,
7878 ] ;
7979
8080 const result = groupNotificationsByRepository ( notifications ) ;
@@ -87,10 +87,10 @@ describe('renderer/utils/notifications/group.ts', () => {
8787 it ( 'returns repository-grouped order when groupBy is REPOSITORY' , ( ) => {
8888 const settings = { ...mockSettings , groupBy : GroupBy . REPOSITORY } ;
8989 const notifications : Notification [ ] = [
90- createMockNotificationForRepoName ( '1' , 'owner/repo-b' ) ,
91- createMockNotificationForRepoName ( '2' , 'owner/repo-a' ) ,
92- createMockNotificationForRepoName ( '3' , 'owner/repo-b' ) ,
93- createMockNotificationForRepoName ( '4' , 'owner/repo-a' ) ,
90+ mockNotificationWithRepoName ( '1' , 'owner/repo-b' ) ,
91+ mockNotificationWithRepoName ( '2' , 'owner/repo-a' ) ,
92+ mockNotificationWithRepoName ( '3' , 'owner/repo-b' ) ,
93+ mockNotificationWithRepoName ( '4' , 'owner/repo-a' ) ,
9494 ] ;
9595
9696 const result = getFlattenedNotificationsByRepo ( notifications , settings ) ;
@@ -102,9 +102,9 @@ describe('renderer/utils/notifications/group.ts', () => {
102102 it ( 'returns natural account order when groupBy is DATE' , ( ) => {
103103 const settings = { ...mockSettings , groupBy : GroupBy . DATE } ;
104104 const notifications : Notification [ ] = [
105- createMockNotificationForRepoName ( '1' , 'owner/repo-b' ) ,
106- createMockNotificationForRepoName ( '2' , 'owner/repo-a' ) ,
107- createMockNotificationForRepoName ( '3' , 'owner/repo-b' ) ,
105+ mockNotificationWithRepoName ( '1' , 'owner/repo-b' ) ,
106+ mockNotificationWithRepoName ( '2' , 'owner/repo-a' ) ,
107+ mockNotificationWithRepoName ( '3' , 'owner/repo-b' ) ,
108108 ] ;
109109
110110 const result = getFlattenedNotificationsByRepo ( notifications , settings ) ;
@@ -125,9 +125,9 @@ describe('renderer/utils/notifications/group.ts', () => {
125125 it ( 'handles notifications without repository data when grouped' , ( ) => {
126126 const settings = { ...mockSettings , groupBy : GroupBy . REPOSITORY } ;
127127 const notifications : Notification [ ] = [
128- createMockNotificationForRepoName ( '1' , 'owner/repo-a' ) ,
129- createMockNotificationForRepoName ( '2' , null ) ,
130- createMockNotificationForRepoName ( '3' , 'owner/repo-a' ) ,
128+ mockNotificationWithRepoName ( '1' , 'owner/repo-a' ) ,
129+ mockNotificationWithRepoName ( '2' , null ) ,
130+ mockNotificationWithRepoName ( '3' , 'owner/repo-a' ) ,
131131 ] ;
132132
133133 const result = getFlattenedNotificationsByRepo ( notifications , settings ) ;
@@ -139,9 +139,9 @@ describe('renderer/utils/notifications/group.ts', () => {
139139 it ( 'preserves notifications without repository data when not grouped' , ( ) => {
140140 const settings = { ...mockSettings , groupBy : GroupBy . DATE } ;
141141 const notifications : Notification [ ] = [
142- createMockNotificationForRepoName ( '1' , 'owner/repo-a' ) ,
143- createMockNotificationForRepoName ( '2' , null ) ,
144- createMockNotificationForRepoName ( '3' , 'owner/repo-a' ) ,
142+ mockNotificationWithRepoName ( '1' , 'owner/repo-a' ) ,
143+ mockNotificationWithRepoName ( '2' , null ) ,
144+ mockNotificationWithRepoName ( '3' , 'owner/repo-a' ) ,
145145 ] ;
146146
147147 const result = getFlattenedNotificationsByRepo ( notifications , settings ) ;
0 commit comments