@@ -65,89 +65,79 @@ describe('renderer/routes/Filters.tsx', () => {
6565 } ) ;
6666
6767 describe ( 'Users section' , ( ) => {
68- it ( 'should not be able to toggle the hideBots checkbox when detailedNotifications is disabled' , async ( ) => {
69- await act ( async ( ) => {
70- render (
71- < AppContext . Provider
72- value = { {
73- auth : mockAuth ,
74- settings : {
75- ...mockSettings ,
76- detailedNotifications : false ,
77- hideBots : false ,
78- } ,
79- notifications : [ ] ,
80- updateSetting,
81- } }
82- >
83- < MemoryRouter >
84- < FiltersRoute />
85- </ MemoryRouter >
86- </ AppContext . Provider > ,
87- ) ;
88- } ) ;
89-
90- expect (
91- screen
92- . getByLabelText ( 'Hide notifications from Bot accounts' )
93- . closest ( 'input' ) ,
94- ) . toHaveProperty ( 'disabled' , true ) ;
95-
96- // click the checkbox
97- fireEvent . click (
98- screen . getByLabelText ( 'Hide notifications from Bot accounts' ) ,
99- ) ;
100-
101- // check if the checkbox is still unchecked
102- expect ( updateSetting ) . not . toHaveBeenCalled ( ) ;
103-
104- expect (
105- screen . getByLabelText ( 'Hide notifications from Bot accounts' ) . parentNode
106- . parentNode ,
107- ) . toMatchSnapshot ( ) ;
108- } ) ;
109-
110- it ( 'should be able to toggle the hideBots checkbox when detailedNotifications is enabled' , async ( ) => {
111- await act ( async ( ) => {
112- render (
113- < AppContext . Provider
114- value = { {
115- auth : mockAuth ,
116- settings : {
117- ...mockSettings ,
118- detailedNotifications : true ,
119- hideBots : false ,
120- } ,
121- notifications : [ ] ,
122- updateSetting,
123- } }
124- >
125- < MemoryRouter >
126- < FiltersRoute />
127- </ MemoryRouter >
128- </ AppContext . Provider > ,
129- ) ;
130- } ) ;
131-
132- expect (
133- screen
134- . getByLabelText ( 'Hide notifications from Bot accounts' )
135- . closest ( 'input' ) ,
136- ) . toHaveProperty ( 'disabled' , false ) ;
137-
138- // click the checkbox
139- fireEvent . click (
140- screen . getByLabelText ( 'Hide notifications from Bot accounts' ) ,
141- ) ;
142-
143- // check if the checkbox is still unchecked
144- expect ( updateSetting ) . toHaveBeenCalledWith ( 'hideBots' , true ) ;
145-
146- expect (
147- screen . getByLabelText ( 'Hide notifications from Bot accounts' ) . parentNode
148- . parentNode ,
149- ) . toMatchSnapshot ( ) ;
150- } ) ;
68+ // it('should not be able to toggle the hideBots checkbox when detailedNotifications is disabled', async () => {
69+ // await act(async () => {
70+ // render(
71+ // <AppContext.Provider
72+ // value={{
73+ // auth: mockAuth,
74+ // settings: {
75+ // ...mockSettings,
76+ // detailedNotifications: false,
77+ // },
78+ // notifications: [],
79+ // updateSetting,
80+ // }}
81+ // >
82+ // <MemoryRouter>
83+ // <FiltersRoute />
84+ // </MemoryRouter>
85+ // </AppContext.Provider>,
86+ // );
87+ // });
88+ // expect(
89+ // screen
90+ // .getByLabelText('Hide notifications from Bot accounts')
91+ // .closest('input'),
92+ // ).toHaveProperty('disabled', true);
93+ // // click the checkbox
94+ // fireEvent.click(
95+ // screen.getByLabelText('Hide notifications from Bot accounts'),
96+ // );
97+ // // check if the checkbox is still unchecked
98+ // expect(updateSetting).not.toHaveBeenCalled();
99+ // expect(
100+ // screen.getByLabelText('Hide notifications from Bot accounts').parentNode
101+ // .parentNode,
102+ // ).toMatchSnapshot();
103+ // });
104+ // it('should be able to toggle the hideBots checkbox when detailedNotifications is enabled', async () => {
105+ // await act(async () => {
106+ // render(
107+ // <AppContext.Provider
108+ // value={{
109+ // auth: mockAuth,
110+ // settings: {
111+ // ...mockSettings,
112+ // detailedNotifications: true,
113+ // hideBots: false,
114+ // },
115+ // notifications: [],
116+ // updateSetting,
117+ // }}
118+ // >
119+ // <MemoryRouter>
120+ // <FiltersRoute />
121+ // </MemoryRouter>
122+ // </AppContext.Provider>,
123+ // );
124+ // });
125+ // expect(
126+ // screen
127+ // .getByLabelText('Hide notifications from Bot accounts')
128+ // .closest('input'),
129+ // ).toHaveProperty('disabled', false);
130+ // // click the checkbox
131+ // fireEvent.click(
132+ // screen.getByLabelText('Hide notifications from Bot accounts'),
133+ // );
134+ // // check if the checkbox is still unchecked
135+ // expect(updateSetting).toHaveBeenCalledWith('hideBots', true);
136+ // expect(
137+ // screen.getByLabelText('Hide notifications from Bot accounts').parentNode
138+ // .parentNode,
139+ // ).toMatchSnapshot();
140+ // });
151141 } ) ;
152142
153143 describe ( 'Reasons section' , ( ) => {
0 commit comments