@@ -5,6 +5,11 @@ import {
5
5
mockPersonalAccessTokenAccount ,
6
6
} from '../__mocks__/state-mocks' ;
7
7
8
+ import {
9
+ ChevronDownIcon ,
10
+ ChevronLeftIcon ,
11
+ ChevronRightIcon ,
12
+ } from '@primer/octicons-react' ;
8
13
import log from 'electron-log' ;
9
14
import { defaultSettings } from '../context/App' ;
10
15
import type { Hostname , Link , SettingsState } from '../types' ;
@@ -19,6 +24,7 @@ import {
19
24
formatNotificationUpdatedAt ,
20
25
generateGitHubWebUrl ,
21
26
generateNotificationReferrerId ,
27
+ getChevronDetails ,
22
28
getFilterCount ,
23
29
getPlatformFromHostname ,
24
30
isEnterpriseServerHost ,
@@ -629,4 +635,23 @@ describe('renderer/utils/helpers.ts', () => {
629
635
expect ( getFilterCount ( settings ) ) . toBe ( 1 ) ;
630
636
} ) ;
631
637
} ) ;
638
+
639
+ describe ( 'getChevronDetails' , ( ) => {
640
+ it ( 'should return correct chevron details' , ( ) => {
641
+ expect ( getChevronDetails ( true , true , 'account' ) ) . toEqual ( {
642
+ icon : ChevronDownIcon ,
643
+ label : 'Hide account notifications' ,
644
+ } ) ;
645
+
646
+ expect ( getChevronDetails ( true , false , 'account' ) ) . toEqual ( {
647
+ icon : ChevronRightIcon ,
648
+ label : 'Show account notifications' ,
649
+ } ) ;
650
+
651
+ expect ( getChevronDetails ( false , false , 'account' ) ) . toEqual ( {
652
+ icon : ChevronLeftIcon ,
653
+ label : 'No notifications for account' ,
654
+ } ) ;
655
+ } ) ;
656
+ } ) ;
632
657
} ) ;
0 commit comments