@@ -5,6 +5,11 @@ import {
55 mockPersonalAccessTokenAccount ,
66} from '../__mocks__/state-mocks' ;
77
8+ import {
9+ ChevronDownIcon ,
10+ ChevronLeftIcon ,
11+ ChevronRightIcon ,
12+ } from '@primer/octicons-react' ;
813import log from 'electron-log' ;
914import { defaultSettings } from '../context/App' ;
1015import type { Hostname , Link , SettingsState } from '../types' ;
@@ -19,6 +24,7 @@ import {
1924 formatNotificationUpdatedAt ,
2025 generateGitHubWebUrl ,
2126 generateNotificationReferrerId ,
27+ getChevronDetails ,
2228 getFilterCount ,
2329 getPlatformFromHostname ,
2430 isEnterpriseServerHost ,
@@ -629,4 +635,23 @@ describe('renderer/utils/helpers.ts', () => {
629635 expect ( getFilterCount ( settings ) ) . toBe ( 1 ) ;
630636 } ) ;
631637 } ) ;
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+ } ) ;
632657} ) ;
0 commit comments