diff --git a/crates/matrix-sdk-ui/src/notification_client.rs b/crates/matrix-sdk-ui/src/notification_client.rs index a4b24b49b..d0abaece1 100644 --- a/crates/matrix-sdk-ui/src/notification_client.rs +++ b/crates/matrix-sdk-ui/src/notification_client.rs @@ -415,6 +415,7 @@ impl NotificationClient { } } +#[derive(Debug)] pub enum NotificationStatus { Event(NotificationItem), EventNotFound, diff --git a/testing/sliding-sync-integration-test/src/notification_client.rs b/testing/sliding-sync-integration-test/src/notification_client.rs index 3ff92e7bf..dc243e07a 100644 --- a/testing/sliding-sync-integration-test/src/notification_client.rs +++ b/testing/sliding-sync-integration-test/src/notification_client.rs @@ -76,11 +76,10 @@ async fn test_notification() -> Result<()> { // Try with sliding sync first. let notification_client = NotificationClient::builder(bob.clone()).await.unwrap().build(); - let NotificationStatus::Event(notification) = - notification_client.get_notification_with_sliding_sync(&room_id, &event_id).await? - else { - panic!("event not found"); - }; + let notification = assert_matches!( + notification_client.get_notification_with_sliding_sync(&room_id, &event_id).await?, + NotificationStatus::Event(event) => event + ); warn!("sliding_sync: checking invite notification"); @@ -191,11 +190,10 @@ async fn test_notification() -> Result<()> { }; let notification_client = NotificationClient::builder(bob.clone()).await.unwrap().build(); - let NotificationStatus::Event(notification) = - notification_client.get_notification_with_sliding_sync(&room_id, &event_id).await? - else { - panic!("event not found"); - }; + let notification = assert_matches!( + notification_client.get_notification_with_sliding_sync(&room_id, &event_id).await?, + NotificationStatus::Event(item) => item + ); check_notification(true, notification); let notification_client = NotificationClient::builder(bob.clone()).await.unwrap().build();