Skip to content

Commit

Permalink
message test [nfc]: Tighten message-deletion test slightly
Browse files Browse the repository at this point in the history
The `length` check isn't needed because it's covered by the
`deepEquals`.  (It was needed in a previous draft of this test).

Then we can also inline `expected`, and reformat slightly.
  • Loading branch information
gnprice committed Jul 2, 2024
1 parent c4ca1ab commit 1f97563
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/model/message_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,11 @@ void main() {
check(model).messages.length.equals(30);
await store.handleEvent(eg.deleteMessageEvent(messagesToDelete));
checkNotifiedOnce();
final expected = [
check(model.messages.map((message) => message.id)).deepEquals([
...messages.sublist(0, 2),
...messages.sublist(5, 10),
...messages.sublist(15)].map((message) => message.id);
check(model).messages.length.equals(expected.length);
check(model.messages.map((message) => message.id)).deepEquals(expected);
...messages.sublist(15),
].map((message) => message.id));
});
});

Expand Down

0 comments on commit 1f97563

Please sign in to comment.