From faee647c3a04319d51c2a0f19ca9de0eaac3be61 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 21 Aug 2025 12:02:57 +0200 Subject: [PATCH] tests: get rid of `GlobalAccountDataTestEvent::Direct` --- testing/matrix-sdk-test/src/sync_builder/mod.rs | 1 - .../src/sync_builder/test_event.rs | 2 -- testing/matrix-sdk-test/src/test_json/mod.rs | 2 +- .../matrix-sdk-test/src/test_json/sync_events.rs | 16 ---------------- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/testing/matrix-sdk-test/src/sync_builder/mod.rs b/testing/matrix-sdk-test/src/sync_builder/mod.rs index 2799c734f..2fcbcaed9 100644 --- a/testing/matrix-sdk-test/src/sync_builder/mod.rs +++ b/testing/matrix-sdk-test/src/sync_builder/mod.rs @@ -151,7 +151,6 @@ impl SyncResponseBuilder { event: GlobalAccountDataTestEvent, ) -> &mut Self { let val = match event { - GlobalAccountDataTestEvent::Direct => test_json::DIRECT.to_owned(), GlobalAccountDataTestEvent::PushRules => test_json::PUSH_RULES.to_owned(), GlobalAccountDataTestEvent::IgnoredUserList => test_json::IGNORED_USER_LIST.to_owned(), GlobalAccountDataTestEvent::Custom(json) => json, diff --git a/testing/matrix-sdk-test/src/sync_builder/test_event.rs b/testing/matrix-sdk-test/src/sync_builder/test_event.rs index 28e105572..246e5fe3a 100644 --- a/testing/matrix-sdk-test/src/sync_builder/test_event.rs +++ b/testing/matrix-sdk-test/src/sync_builder/test_event.rs @@ -149,7 +149,6 @@ impl From for Raw { /// Test events that can be added to the global account data. pub enum GlobalAccountDataTestEvent { - Direct, PushRules, IgnoredUserList, Custom(JsonValue), @@ -158,7 +157,6 @@ pub enum GlobalAccountDataTestEvent { impl From for JsonValue { fn from(val: GlobalAccountDataTestEvent) -> Self { match val { - GlobalAccountDataTestEvent::Direct => test_json::sync_events::DIRECT.to_owned(), GlobalAccountDataTestEvent::PushRules => test_json::sync_events::PUSH_RULES.to_owned(), GlobalAccountDataTestEvent::IgnoredUserList => { test_json::sync_events::IGNORED_USER_LIST.to_owned() diff --git a/testing/matrix-sdk-test/src/test_json/mod.rs b/testing/matrix-sdk-test/src/test_json/mod.rs index 79ecd74a8..9393cb9e8 100644 --- a/testing/matrix-sdk-test/src/test_json/mod.rs +++ b/testing/matrix-sdk-test/src/test_json/mod.rs @@ -29,7 +29,7 @@ pub use sync::{ VOIP_SYNC, }; pub use sync_events::{ - ALIAS, ALIASES, DIRECT, ENCRYPTION, IGNORED_USER_LIST, MEMBER, MEMBER_ADDITIONAL, MEMBER_BAN, + ALIAS, ALIASES, ENCRYPTION, IGNORED_USER_LIST, MEMBER, MEMBER_ADDITIONAL, MEMBER_BAN, MEMBER_INVITE, MEMBER_LEAVE, MEMBER_NAME_CHANGE, MEMBER_STRIPPED, NAME, NAME_STRIPPED, POWER_LEVELS, PRESENCE, PUSH_RULES, REDACTED_INVALID, REDACTED_STATE, TAG, TOPIC, TOPIC_REDACTION, diff --git a/testing/matrix-sdk-test/src/test_json/sync_events.rs b/testing/matrix-sdk-test/src/test_json/sync_events.rs index ca0898b51..ae73f7b71 100644 --- a/testing/matrix-sdk-test/src/test_json/sync_events.rs +++ b/testing/matrix-sdk-test/src/test_json/sync_events.rs @@ -57,22 +57,6 @@ pub static CREATE: Lazy = Lazy::new(|| { }) }); -pub static DIRECT: Lazy = Lazy::new(|| { - json!({ - "content": { - "@invited:localhost": [*DEFAULT_TEST_ROOM_ID], - }, - "event_id": "$757957878228ekrDs:localhost", - "origin_server_ts": 17195787, - "sender": "@example:localhost", - "state_key": "", - "type": "m.direct", - "unsigned": { - "age": 139298 - } - }) -}); - pub static FULLY_READ: Lazy = Lazy::new(|| { json!({ "content": {