Skip to content

Commit 53fbf77

Browse files
gnpricechrisbobbe
authored andcommitted
test: Take a selfUser parameter in eg.store
1 parent e0793b4 commit 53fbf77

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/example_data.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ Account account({
313313
ackedPushToken: ackedPushToken,
314314
);
315315
}
316+
const _account = account;
316317

317318
/// A [User] which throws on attempting to mutate any of its fields.
318319
///
@@ -1285,10 +1286,13 @@ const _initialSnapshot = initialSnapshot;
12851286

12861287
PerAccountStore store({
12871288
GlobalStore? globalStore,
1289+
User? selfUser,
12881290
Account? account,
12891291
InitialSnapshot? initialSnapshot,
12901292
}) {
1291-
final effectiveAccount = account ?? selfAccount;
1293+
assert(!(account != null && selfUser != null));
1294+
final effectiveAccount = account
1295+
?? (selfUser != null ? _account(user: selfUser) : selfAccount);
12921296
return PerAccountStore.fromInitialSnapshot(
12931297
globalStore: globalStore ?? _globalStore(accounts: [effectiveAccount]),
12941298
accountId: effectiveAccount.id,

0 commit comments

Comments
 (0)