Skip to content

Commit 63f8fe0

Browse files
committed
test store [nfc]: Support adding delay to loadPerAccount
Signed-off-by: Zixuan James Li <[email protected]>
1 parent 811ab86 commit 63f8fe0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/model/test_store.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class TestGlobalStore extends GlobalStore {
125125
}
126126

127127
static const Duration removeAccountDuration = Duration(milliseconds: 1);
128+
Duration? loadPerAccountDuration;
128129

129130
/// Consume the log of calls made to [doRemoveAccount].
130131
List<int> takeDoRemoveAccountCalls() {
@@ -142,7 +143,10 @@ class TestGlobalStore extends GlobalStore {
142143
}
143144

144145
@override
145-
Future<PerAccountStore> doLoadPerAccount(int accountId) {
146+
Future<PerAccountStore> doLoadPerAccount(int accountId) async {
147+
if (loadPerAccountDuration != null) {
148+
await Future<void>.delayed(loadPerAccountDuration!);
149+
}
146150
final initialSnapshot = _initialSnapshots[accountId]!;
147151
final store = PerAccountStore.fromInitialSnapshot(
148152
globalStore: this,

0 commit comments

Comments
 (0)