Skip to content

Commit baca9ac

Browse files
committed
msglist test: Call checkInvariants on checkNotNotified.
We already always check the invariants through a listener on the MessageListView instance. Now we do it more consistently when not notified. Signed-off-by: Zixuan James Li <[email protected]>
1 parent 0399af6 commit baca9ac

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

test/model/message_list_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ void main() {
3333
check(notifiedCount).equals(count);
3434
notifiedCount = 0;
3535
}
36-
void checkNotNotified() => checkNotified(count: 0);
36+
void checkNotNotified() {
37+
checkInvariants(model);
38+
checkNotified(count: 0);
39+
}
3740
void checkNotifiedOnce() => checkNotified(count: 1);
3841

3942
/// Initialize [model] and the rest of the test state.
@@ -51,7 +54,6 @@ void main() {
5154
notifiedCount++;
5255
});
5356
check(model).fetched.isFalse();
54-
checkInvariants(model);
5557
checkNotNotified();
5658
}
5759

@@ -97,7 +99,6 @@ void main() {
9799
).toJson());
98100
final fetchFuture = model.fetchInitial();
99101
check(model).fetched.isFalse();
100-
checkInvariants(model);
101102

102103
checkNotNotified();
103104
await fetchFuture;
@@ -185,7 +186,6 @@ void main() {
185186
// Don't prepare another response.
186187
final fetchFuture2 = model.fetchOlder();
187188
checkNotNotified();
188-
checkInvariants(model);
189189
check(model).fetchingOlder.isTrue();
190190

191191
await fetchFuture;
@@ -210,7 +210,6 @@ void main() {
210210
// We must not have made a request, because we didn't
211211
// prepare a response and didn't get an exception.
212212
checkNotNotified();
213-
checkInvariants(model);
214213
check(model)
215214
..haveOldest.isTrue()
216215
..messages.length.equals(30);
@@ -268,7 +267,6 @@ void main() {
268267
message: eg.streamMessage(stream: stream)));
269268
checkNotNotified();
270269
check(model).fetched.isFalse();
271-
checkInvariants(model);
272270
});
273271

274272
group('notifyListenersIfMessagePresent', () {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'package:flutter_test/flutter_test.dart';
2+
3+
void main() {
4+
// What to test?
5+
// moved/edited marker shown after event updates
6+
group('', () {
7+
testWidgets('', (tester) async {
8+
9+
});
10+
});
11+
}

0 commit comments

Comments
 (0)