Skip to content

Commit c52961d

Browse files
committed
store test: Check for data consistency when adding account
This covers some of the fields that can be inconsistent (`zulipFeatureLevel` in particular) when a test is not set up properly Signed-off-by: Zixuan James Li <[email protected]>
1 parent cac0171 commit c52961d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/model/test_store.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ class TestGlobalStore extends GlobalStore {
8585
/// [PerAccountStore] when [perAccount] is subsequently called for this
8686
/// account, in particular when a [PerAccountStoreWidget] is mounted.
8787
Future<void> add(Account account, InitialSnapshot initialSnapshot) async {
88+
assert(initialSnapshot.zulipVersion == account.zulipVersion);
89+
assert(initialSnapshot.zulipMergeBase == account.zulipMergeBase);
90+
assert(initialSnapshot.zulipFeatureLevel == account.zulipFeatureLevel);
8891
await insertAccount(account.toCompanion(false));
8992
assert(!_initialSnapshots.containsKey(account.id));
9093
_initialSnapshots[account.id] = initialSnapshot;

0 commit comments

Comments
 (0)