@@ -17,10 +17,8 @@ import 'package:zulip/api/route/realm.dart';
1717import 'package:zulip/log.dart' ;
1818import 'package:zulip/model/actions.dart' ;
1919import 'package:zulip/model/presence.dart' ;
20- import 'package:zulip/model/push_device.dart' ;
2120import 'package:zulip/model/server_support.dart' ;
2221import 'package:zulip/model/store.dart' ;
23- import 'package:zulip/notifications/receive.dart' ;
2422
2523import '../api/fake_api.dart' ;
2624import '../api/model/model_checks.dart' ;
@@ -137,17 +135,14 @@ void main() {
137135 }));
138136
139137 test ('GlobalStore.perAccount loading succeeds' , () => awaitFakeAsync ((async ) async {
140- NotificationService .instance.token = ValueNotifier ('asdf' );
141- addTearDown (NotificationService .debugReset);
142-
143138 final globalStore = UpdateMachineTestGlobalStore (accounts: [eg.selfAccount]);
144139 final connection = globalStore.apiConnectionFromAccount (eg.selfAccount) as FakeApiConnection ;
145140 final future = globalStore.perAccount (eg.selfAccount.id);
146141 check (connection.takeRequests ()).length.equals (1 ); // register request
147142
148143 await future;
149- // poll, server-emoji-data, register-token requests
150- check (connection.takeRequests ()).length.equals (3 );
144+ // poll and server-emoji-data requests
145+ check (connection.takeRequests ()).length.equals (2 );
151146 check (connection).isOpen.isTrue ();
152147 }));
153148
@@ -163,7 +158,7 @@ void main() {
163158
164159 await check (future).throws <AccountNotFoundException >();
165160 check (globalStore.takeDoRemoveAccountCalls ()).single.equals (eg.selfAccount.id);
166- // no poll, server-emoji-data, or register-token requests
161+ // no poll or other follow-up requests
167162 check (connection.takeRequests ()).isEmpty ();
168163 check (connection).isOpen.isFalse ();
169164 }));
@@ -182,7 +177,7 @@ void main() {
182177
183178 await check (future).throws <AccountNotFoundException >();
184179 check (globalStore.takeDoRemoveAccountCalls ()).single.equals (eg.selfAccount.id);
185- // no poll, server-emoji-data, or register-token requests
180+ // no poll or other follow-up requests
186181 check (connection.takeRequests ()).isEmpty ();
187182 check (connection).isOpen.isFalse ();
188183 }));
@@ -203,7 +198,7 @@ void main() {
203198
204199 await check (future).throws <AccountNotFoundException >();
205200 check (globalStore.takeDoRemoveAccountCalls ()).isEmpty ();
206- // no poll, server-emoji-data, or register-token requests
201+ // no poll or other follow-up requests
207202 check (connection.takeRequests ()).isEmpty ();
208203 check (connection).isOpen.isFalse ();
209204 }));
@@ -224,7 +219,7 @@ void main() {
224219
225220 await check (future).throws <AccountNotFoundException >();
226221 check (globalStore.takeDoRemoveAccountCalls ()).isEmpty ();
227- // no poll, server-emoji-data, or register-token requests
222+ // no poll or other follow-up requests
228223 check (connection.takeRequests ()).isEmpty ();
229224 check (connection).isOpen.isFalse ();
230225 }));
@@ -246,7 +241,7 @@ void main() {
246241
247242 await check (future).throws <AccountNotFoundException >();
248243 check (globalStore.takeDoRemoveAccountCalls ()).isEmpty ();
249- // no poll, server-emoji-data, or register-token requests
244+ // no poll or other follow-up requests
250245 check (connection.takeRequests ()).isEmpty ();
251246 check (connection).isOpen.isFalse ();
252247 }));
@@ -270,7 +265,7 @@ void main() {
270265
271266 await check (future).throws <AccountNotFoundException >();
272267 check (globalStore.takeDoRemoveAccountCalls ()).isEmpty ();
273- // no poll, server-emoji-data, or register-token requests
268+ // no poll or other follow-up requests
274269 check (connection.takeRequests ()).isEmpty ();
275270 check (connection).isOpen.isFalse ();
276271 }));
@@ -294,7 +289,7 @@ void main() {
294289
295290 await check (future).throws <AccountNotFoundException >();
296291 check (globalStore.takeDoRemoveAccountCalls ()).isEmpty ();
297- // no retry-register, poll, server-emoji-data, or register-token requests
292+ // no retry-register, poll, or other follow-up requests
298293 check (connection.takeRequests ()).isEmpty ();
299294 check (connection).isOpen.isFalse ();
300295 }));
@@ -484,8 +479,6 @@ void main() {
484479 as FakeApiConnection );
485480 UpdateMachine .debugEnableFetchEmojiData = false ;
486481 addTearDown (() => UpdateMachine .debugEnableFetchEmojiData = true );
487- PushDeviceManager .debugEnableRegisterToken = false ;
488- addTearDown (() => PushDeviceManager .debugEnableRegisterToken = true );
489482 }
490483
491484 void checkLastRequest () {
@@ -572,7 +565,6 @@ void main() {
572565 }));
573566
574567 // TODO test UpdateMachine.load starts polling loop
575- // TODO test UpdateMachine.load calls [PushDeviceManager.registerToken]
576568 });
577569
578570 group ('UpdateMachine.fetchEmojiData' , () {
0 commit comments