Skip to content

Commit 1d24f6d

Browse files
PIG208gnprice
authored andcommitted
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 4a906d5 commit 1d24f6d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/model/message_list_test.dart

+4-6
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', () {

0 commit comments

Comments
 (0)