Skip to content

Commit 8f693f4

Browse files
yousefmoazzambnjbvr
authored andcommitted
test: create plain text room event with EventFactory
1 parent fe8f77e commit 8f693f4

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

crates/matrix-sdk-ui/src/timeline/tests/shields.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use assert_matches::assert_matches;
22
use eyeball_im::VectorDiff;
3-
use matrix_sdk_base::deserialized_responses::{ShieldState, ShieldStateCode, TimelineEvent};
4-
use matrix_sdk_test::{async_test, sync_timeline_event, ALICE};
3+
use matrix_sdk_base::deserialized_responses::{ShieldState, ShieldStateCode};
4+
use matrix_sdk_test::{async_test, event_factory::EventFactory, sync_timeline_event, ALICE};
55
use ruma::{
66
event_id,
77
events::{
@@ -100,16 +100,14 @@ async fn test_local_sent_in_clear_shield() {
100100

101101
// When the remote echo comes in.
102102
timeline
103-
.handle_live_event(TimelineEvent::new(sync_timeline_event!({
104-
"content": {
105-
"body": "Local message",
106-
"msgtype": "m.text",
107-
},
108-
"sender": &*ALICE,
109-
"event_id": event_id,
110-
"origin_server_ts": timestamp,
111-
"type": "m.room.message",
112-
})))
103+
.handle_live_event(
104+
EventFactory::new()
105+
.text_msg("Local message")
106+
.sender(*ALICE)
107+
.event_id(event_id)
108+
.server_ts(timestamp)
109+
.into_event(),
110+
)
113111
.await;
114112
assert_next_matches!(stream, VectorDiff::Remove { index: 1 });
115113
let item = assert_next_matches!(stream, VectorDiff::PushFront { value } => value);

0 commit comments

Comments
 (0)