Skip to content

Commit

Permalink
finish testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gnprice committed Nov 2, 2023
1 parent 0c6a4a3 commit 0addfd5
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions test/notifications_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,19 @@ void main() {
selfUserId: eg.selfUser.userId));
}

testWidgets('stream message', (tester) async {
testBinding.globalStore.insertAccount(eg.selfAccount.toCompanion(false));
await prepare(tester);
checkOpenNotification(eg.selfAccount, eg.streamMessage());
});

testWidgets('direct message', (tester) async {
testBinding.globalStore.insertAccount(eg.selfAccount.toCompanion(false));
await prepare(tester);
checkOpenNotification(eg.selfAccount,
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]));
});

testWidgets('no widgets in tree', (tester) async {
await init();
final message = eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]);
Expand All @@ -234,23 +247,11 @@ void main() {
check(pushedRoutes).isEmpty();
});

testWidgets('stream message', (tester) async {
testBinding.globalStore.add(eg.selfAccount, eg.initialSnapshot());
await prepare(tester);
checkOpenNotification(eg.selfAccount, eg.streamMessage());
});

testWidgets('direct message', (tester) async {
testBinding.globalStore.add(eg.selfAccount, eg.initialSnapshot());
await prepare(tester);
checkOpenNotification(eg.selfAccount,
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]));
});

testWidgets('account but no server data yet', (tester) async {
testWidgets('mismatching account', (tester) async {
testBinding.globalStore.insertAccount(eg.selfAccount.toCompanion(false));
await prepare(tester);
checkOpenNotification(eg.selfAccount, eg.streamMessage());
openNotification(eg.otherAccount, eg.streamMessage());
check(pushedRoutes).isEmpty();
});

testWidgets('find account among several', (tester) async {
Expand Down

0 comments on commit 0addfd5

Please sign in to comment.