From f4f63a7e41e6a442bdc565727162e956da94ff4e Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Thu, 22 May 2025 22:24:51 +0100 Subject: [PATCH] test: create plain text room event with `EventFactory` --- .../tests/integration/notification_client.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk-ui/tests/integration/notification_client.rs b/crates/matrix-sdk-ui/tests/integration/notification_client.rs index 6522ba9c1..a18282b6f 100644 --- a/crates/matrix-sdk-ui/tests/integration/notification_client.rs +++ b/crates/matrix-sdk-ui/tests/integration/notification_client.rs @@ -6,7 +6,7 @@ use std::{ use assert_matches::assert_matches; use matrix_sdk::{config::SyncSettings, test_utils::logged_in_client_with_server}; use matrix_sdk_test::{ - async_test, mocks::mock_encryption_state, sync_timeline_event, JoinedRoomBuilder, + async_test, event_factory::EventFactory, mocks::mock_encryption_state, JoinedRoomBuilder, StateTestEvent, SyncResponseBuilder, }; use matrix_sdk_ui::{ @@ -51,7 +51,14 @@ async fn test_notification_client_with_context() { let mut sync_builder = SyncResponseBuilder::new(); sync_builder.add_joined_room( - JoinedRoomBuilder::new(room_id).add_timeline_event(sync_timeline_event!(event_json)), + JoinedRoomBuilder::new(room_id).add_timeline_event( + EventFactory::new() + .text_msg("Hello world!") + .event_id(event_id) + .server_ts(152049794) + .sender(sender) + .into_raw_sync(), + ), ); // First, mock a sync that contains a text message.