@@ -19,7 +19,6 @@ import { mocked } from "jest-mock";
1919
2020import {
2121 localNotificationsAreSilenced ,
22- createLocalNotificationSettingsIfNeeded ,
2322 getLocalNotificationAccountDataEventType ,
2423} from "../../src/utils/notifications" ;
2524import SettingsStore from "../../src/settings/SettingsStore" ;
@@ -47,38 +46,6 @@ describe('notifications', () => {
4746 mocked ( SettingsStore ) . getValue . mockReturnValue ( false ) ;
4847 } ) ;
4948
50- describe ( 'createLocalNotification' , ( ) => {
51- it ( 'creates account data event' , async ( ) => {
52- await createLocalNotificationSettingsIfNeeded ( mockClient ) ;
53- const event = mockClient . getAccountData ( accountDataEventKey ) ;
54- expect ( event ?. getContent ( ) . is_silenced ) . toBe ( true ) ;
55- } ) ;
56-
57- // Can't figure out why the mock does not override the value here
58- /*.each(deviceNotificationSettingsKeys) instead of skip */
59- it . skip ( "unsilenced for existing sessions" , async ( /*settingKey*/ ) => {
60- mocked ( SettingsStore )
61- . getValue
62- . mockImplementation ( ( key ) => {
63- // return key === settingKey;
64- } ) ;
65-
66- await createLocalNotificationSettingsIfNeeded ( mockClient ) ;
67- const event = mockClient . getAccountData ( accountDataEventKey ) ;
68- expect ( event ?. getContent ( ) . is_silenced ) . toBe ( false ) ;
69- } ) ;
70-
71- it ( "does not override an existing account event data" , async ( ) => {
72- mockClient . setAccountData ( accountDataEventKey , {
73- is_silenced : false ,
74- } ) ;
75-
76- await createLocalNotificationSettingsIfNeeded ( mockClient ) ;
77- const event = mockClient . getAccountData ( accountDataEventKey ) ;
78- expect ( event ?. getContent ( ) . is_silenced ) . toBe ( false ) ;
79- } ) ;
80- } ) ;
81-
8249 describe ( 'localNotificationsAreSilenced' , ( ) => {
8350 it ( 'defaults to true when no setting exists' , ( ) => {
8451 expect ( localNotificationsAreSilenced ( mockClient ) ) . toBeTruthy ( ) ;
0 commit comments