@@ -20,6 +20,7 @@ import 'package:zulip/model/presence.dart';
2020import  'package:zulip/model/server_support.dart' ;
2121import  'package:zulip/model/store.dart' ;
2222
23+ import  '../api/core_checks.dart' ;
2324import  '../api/fake_api.dart' ;
2425import  '../api/model/model_checks.dart' ;
2526import  '../example_data.dart'  as  eg;
@@ -465,6 +466,42 @@ void main() {
465466    // Mostly this method just dispatches to ChannelStore and MessageStore etc., 
466467    // and so its tests generally live in the test files for those 
467468    // (but they call the handleEvent method because it's the entry point). 
469+ 
470+     test ('RestartEvent updates versions' , () async  {
471+       final  account =  eg.account (user:  eg.selfUser,
472+         zulipFeatureLevel:  123 ,
473+         zulipMergeBase:  '6.0' ,
474+         zulipVersion:  '6.0+gabcd' ,
475+       );
476+       final  globalStore =  eg.globalStore ();
477+       await  globalStore.add (account, eg.initialSnapshot (
478+         zulipFeatureLevel:  123 ,
479+         zulipMergeBase:  '6.0' ,
480+         zulipVersion:  '6.0+gabcd' ,
481+       ));
482+       final  store =  await  globalStore.perAccount (account.id);
483+ 
484+       int  globalUpdateCount =  0 ;
485+       globalStore.addListener (() =>  globalUpdateCount++ );
486+       int  updateCount =  0 ;
487+       store.addListener (() =>  updateCount++ );
488+ 
489+       await  store.handleEvent (RestartEvent (
490+         id:  1 ,
491+         zulipVersion:  '8.0+g9876' ,
492+         zulipMergeBase:  '8.0' ,
493+         zulipFeatureLevel:  234 ,
494+         serverGeneration:  1708639638 ,
495+       ));
496+       check (globalUpdateCount).isGreaterThan (0 );
497+       check (updateCount).isGreaterThan (0 );
498+       check (store)
499+         ..account.which ((account) =>  account
500+           ..zulipVersion.equals ('8.0+g9876' )
501+           ..zulipMergeBase.equals ('8.0' )
502+           ..zulipFeatureLevel.equals (234 ))
503+         ..connection.zulipFeatureLevel.equals (234 );
504+     });
468505  });
469506
470507  group ('UpdateMachine.load' , () {
0 commit comments