Skip to content

Commit 62fb55a

Browse files
committed
msglist test: Adapt UpdateMessageEvent edit tests to go through whole store
1 parent 4fd39c0 commit 62fb55a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/model/message_list_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void main() {
306306
});
307307
});
308308

309-
group('handleUpdateMessageEvent', () {
309+
group('UpdateMessageEvent', () {
310310
test('update a message', () async {
311311
final originalMessage = eg.streamMessage(
312312
content: "<p>Hello, world</p>");
@@ -326,7 +326,7 @@ void main() {
326326
..flags.not((it) => it.deepEquals(updateEvent.flags))
327327
..isMeMessage.not((it) => it.equals(updateEvent.isMeMessage!));
328328

329-
model.handleUpdateMessageEvent(updateEvent);
329+
await store.handleEvent(updateEvent);
330330
checkNotifiedOnce();
331331
check(model).messages.single
332332
..identicalTo(message)
@@ -346,7 +346,7 @@ void main() {
346346
await prepare();
347347
await prepareMessages(foundOldest: true, messages: [originalMessage]);
348348

349-
model.handleUpdateMessageEvent(updateEvent);
349+
await store.handleEvent(updateEvent);
350350
checkNotNotified();
351351
check(model).messages.single
352352
..content.equals(originalMessage.content)
@@ -368,7 +368,7 @@ void main() {
368368
await prepareMessages(foundOldest: true, messages: [originalMessage]);
369369
final message = model.messages.single;
370370

371-
model.handleUpdateMessageEvent(updateEvent);
371+
await store.handleEvent(updateEvent);
372372
checkNotifiedOnce();
373373
check(model).messages.single
374374
..identicalTo(message)
@@ -792,17 +792,17 @@ void main() {
792792
await store.handleEvent(MessageEvent(id: 0, message: streamMessage(14)));
793793
checkNotifiedOnce();
794794

795-
// Then test handleUpdateMessageEvent, where a header is and remains needed…
795+
// Then test UpdateMessageEvent edits, where a header is and remains needed…
796796
UpdateMessageEvent updateEvent(Message message) => eg.updateMessageEditEvent(
797797
message, renderedContent: '${message.content}<p>edited</p>',
798798
);
799-
model.handleUpdateMessageEvent(updateEvent(model.messages.first));
799+
await store.handleEvent(updateEvent(model.messages.first));
800800
checkNotifiedOnce();
801-
model.handleUpdateMessageEvent(updateEvent(model.messages[model.messages.length - 2]));
801+
await store.handleEvent(updateEvent(model.messages[model.messages.length - 2]));
802802
checkNotifiedOnce();
803803

804804
// … and where it's not.
805-
model.handleUpdateMessageEvent(updateEvent(model.messages.last));
805+
await store.handleEvent(updateEvent(model.messages.last));
806806
checkNotifiedOnce();
807807

808808
// Then test reassemble.

0 commit comments

Comments
 (0)