File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,29 @@ describe('accountsReducer', () => {
162162 expect ( newState ) . toEqual ( expectedState ) ;
163163 expect ( newState ) . not . toBe ( prevState ) ;
164164 } ) ;
165+
166+ test ( 'records zulipFeatureLevel on active account' , ( ) => {
167+ const prevState = deepFreeze ( [ account1 , account2 , account3 ] ) ;
168+ const newZulipFeatureLevel = 6 ;
169+ const action = deepFreeze ( {
170+ ...eg . action . realm_init ,
171+ data : {
172+ ...eg . action . realm_init . data ,
173+ zulip_feature_level : newZulipFeatureLevel ,
174+ } ,
175+ } ) ;
176+
177+ const expectedState = [
178+ { ...account1 , zulipFeatureLevel : newZulipFeatureLevel } ,
179+ account2 ,
180+ account3 ,
181+ ] ;
182+
183+ const newState = accountsReducer ( prevState , action ) ;
184+
185+ expect ( newState ) . toEqual ( expectedState ) ;
186+ expect ( newState ) . not . toBe ( prevState ) ;
187+ } ) ;
165188 } ) ;
166189
167190 describe ( 'ACCOUNT_SWITCH' , ( ) => {
You can’t perform that action at this time.
0 commit comments