Skip to content

Commit c84aed0

Browse files
committed
test [nfc]: Use eg.globalStore when possible
Later we will add more required parameters to TestGlobalStore. Signed-off-by: Zixuan James Li <[email protected]>
1 parent 2ab1c5c commit c84aed0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/model/binding.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:zulip/model/binding.dart';
1212
import 'package:zulip/model/store.dart';
1313
import 'package:zulip/widgets/app.dart';
1414

15+
import '../example_data.dart' as eg;
1516
import 'test_store.dart';
1617

1718
/// The binding instance used in tests.
@@ -86,7 +87,7 @@ class TestZulipBinding extends ZulipBinding {
8687
///
8788
/// Tests that access this getter, or that mount a [GlobalStoreWidget],
8889
/// should clean up by calling [reset].
89-
TestGlobalStore get globalStore => _globalStore ??= TestGlobalStore(accounts: []);
90+
TestGlobalStore get globalStore => _globalStore ??= eg.globalStore();
9091
TestGlobalStore? _globalStore;
9192

9293
bool _debugAlreadyLoadedStore = false;

test/model/store_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ void main() {
400400
late FakeApiConnection connection;
401401

402402
Future<void> prepareStore({Account? account}) async {
403-
globalStore = TestGlobalStore(accounts: []);
403+
globalStore = eg.globalStore();
404404
account ??= eg.selfAccount;
405405
await globalStore.insertAccount(account.toCompanion(false));
406406
connection = (globalStore.apiConnectionFromAccount(account)
@@ -575,7 +575,7 @@ void main() {
575575
}
576576

577577
Future<void> preparePoll({int? lastEventId}) async {
578-
globalStore = TestGlobalStore(accounts: []);
578+
globalStore = eg.globalStore();
579579
await globalStore.add(eg.selfAccount, eg.initialSnapshot(
580580
lastEventId: lastEventId));
581581
await globalStore.perAccount(eg.selfAccount.id);

0 commit comments

Comments
 (0)