File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,31 @@ describe('routes/Settings.tsx', () => {
106
106
false ,
107
107
) ;
108
108
} ) ;
109
+
110
+ it ( 'should toggle account hostname checkbox' , async ( ) => {
111
+ await act ( async ( ) => {
112
+ render (
113
+ < AppContext . Provider
114
+ value = { {
115
+ settings : mockSettings ,
116
+ auth : mockAuth ,
117
+ updateSetting,
118
+ } }
119
+ >
120
+ < MemoryRouter >
121
+ < SettingsRoute />
122
+ </ MemoryRouter >
123
+ </ AppContext . Provider > ,
124
+ ) ;
125
+ } ) ;
126
+
127
+ await screen . findByLabelText ( 'Show account hostname' ) ;
128
+
129
+ fireEvent . click ( screen . getByLabelText ( 'Show account hostname' ) ) ;
130
+
131
+ expect ( updateSetting ) . toHaveBeenCalledTimes ( 1 ) ;
132
+ expect ( updateSetting ) . toHaveBeenCalledWith ( 'showAccountHostname' , true ) ;
133
+ } ) ;
109
134
} ) ;
110
135
111
136
describe ( 'Notifications section' , ( ) => {
You can’t perform that action at this time.
0 commit comments