Skip to content

Commit e0793b4

Browse files
gnpricechrisbobbe
authored andcommitted
test: Include eg.selfUser by default in eg.initialSnapshot
Over the next few commits, we'll ensure that all tests' data put the self-user in the users list of the initial snapshot. This will help by making that happen automatically for the majority of tests.
1 parent 79061a8 commit e0793b4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

test/example_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ InitialSnapshot initialSnapshot({
12761276
serverEmojiDataUrl: serverEmojiDataUrl
12771277
?? realmUrl.replace(path: '/static/emoji.json'),
12781278
realmEmptyTopicDisplayName: realmEmptyTopicDisplayName ?? defaultRealmEmptyTopicDisplayName,
1279-
realmUsers: realmUsers ?? [],
1279+
realmUsers: realmUsers ?? [selfUser],
12801280
realmNonActiveUsers: realmNonActiveUsers ?? [],
12811281
crossRealmBots: crossRealmBots ?? [],
12821282
);

test/model/autocomplete_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ void main() {
446446
List<Message> messages = const [],
447447
}) async {
448448
store = eg.store(initialSnapshot: eg.initialSnapshot(
449+
realmUsers: users,
449450
recentPrivateConversations: dmConversations));
450-
await store.addUsers(users);
451451
await store.addUserGroups(userGroups);
452452
await store.addMessages(messages);
453453
}

test/widgets/new_dm_sheet_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ Future<void> setupSheet(WidgetTester tester, {
3434
final testNavObserver = TestNavigatorObserver()
3535
..onPushed = (route, _) => lastPushedRoute = route;
3636

37-
await testBinding.globalStore.add(eg.selfAccount, eg.initialSnapshot());
37+
await testBinding.globalStore.add(eg.selfAccount, eg.initialSnapshot(
38+
realmUsers: users,
39+
));
3840
store = await testBinding.globalStore.perAccount(eg.selfAccount.id);
39-
await store.addUsers(users);
4041
if (mutedUserIds != null) {
4142
await store.setMutedUsers(mutedUserIds);
4243
}

0 commit comments

Comments
 (0)