From e3042e664b6259bb3408c445fd2138f670dee93c Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 16 Feb 2026 14:11:00 +0100 Subject: [PATCH] test: delete sync_events.rs Remove the sync_events module entirely now that all usages have been migrated to EventFactory. --- testing/matrix-sdk-test/src/test_json/mod.rs | 4 - .../src/test_json/sync_events.rs | 174 ------------------ 2 files changed, 178 deletions(-) delete mode 100644 testing/matrix-sdk-test/src/test_json/sync_events.rs diff --git a/testing/matrix-sdk-test/src/test_json/mod.rs b/testing/matrix-sdk-test/src/test_json/mod.rs index 102df2afa..2c62f3112 100644 --- a/testing/matrix-sdk-test/src/test_json/mod.rs +++ b/testing/matrix-sdk-test/src/test_json/mod.rs @@ -15,7 +15,6 @@ pub mod keys_query_sets; pub mod members; pub mod search_users; pub mod sync; -pub mod sync_events; pub use api_responses::{ DEVICE, DEVICES, GET_ALIAS, KEYS_QUERY, KEYS_QUERY_TWO_DEVICES_ONE_SIGNED, KEYS_UPLOAD, LOGIN, @@ -27,9 +26,6 @@ pub use members::MEMBERS; pub use sync::{ DEFAULT_SYNC_SUMMARY, INVITE_SYNC, JOIN_SPACE_SYNC, LEAVE_SYNC, LEAVE_SYNC_EVENT, SYNC, }; -pub use sync_events::{ - MEMBER, MEMBER_BAN, MEMBER_INVITE, MEMBER_STRIPPED, NAME, NAME_STRIPPED, POWER_LEVELS, PRESENCE, -}; /// An empty response. pub static EMPTY: Lazy = Lazy::new(|| json!({})); diff --git a/testing/matrix-sdk-test/src/test_json/sync_events.rs b/testing/matrix-sdk-test/src/test_json/sync_events.rs deleted file mode 100644 index 45a02e568..000000000 --- a/testing/matrix-sdk-test/src/test_json/sync_events.rs +++ /dev/null @@ -1,174 +0,0 @@ -//! Discrete events found in a sync response. - -use once_cell::sync::Lazy; -use serde_json::{Value as JsonValue, json}; - -// TODO: Move `prev_content` into `unsigned` once ruma supports it -pub static MEMBER: Lazy = Lazy::new(|| { - json!({ - "content": { - "avatar_url": null, - "displayname": "example", - "membership": "join" - }, - "event_id": "$151800140517rfvjc:localhost", - "membership": "join", - "origin_server_ts": 151800140, - "sender": "@example:localhost", - "state_key": "@example:localhost", - "type": "m.room.member", - "prev_content": { - "avatar_url": null, - "displayname": "example", - "membership": "invite" - }, - "unsigned": { - "age": 297036, - "replaces_state": "$151800111315tsynI:localhost" - } - }) -}); - -pub static MEMBER_BAN: Lazy = Lazy::new(|| { - json!({ - "content": { - "avatar_url": null, - "displayname": "example", - "membership": "ban" - }, - "event_id": "$151800140517rfvjc:localhost", - "origin_server_ts": 151800140, - "sender": "@example:localhost", - "state_key": "@banned:localhost", - "type": "m.room.member", - }) -}); - -pub static MEMBER_INVITE: Lazy = Lazy::new(|| { - json!({ - "content": { - "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF", - "displayname": "example", - "membership": "invite", - "reason": "Looking for support" - }, - "event_id": "$143273582443PhrSn:localhost", - "origin_server_ts": 1432735824, - "room_id": "!jEsUZKDJdhlrceRyVU:localhost", - "sender": "@example:localhost", - "state_key": "@invited:localhost", - "type": "m.room.member", - "unsigned": { - "age": 1234, - "invite_room_state": [ - { - "content": { - "name": "Example Room" - }, - "sender": "@example:localhost", - "state_key": "", - "type": "m.room.name" - }, - { - "content": { - "join_rule": "invite" - }, - "sender": "@example:localhost", - "state_key": "", - "type": "m.room.join_rules" - } - ] - } - }) -}); - -pub static MEMBER_STRIPPED: Lazy = Lazy::new(|| { - json!({ - "content": { - "avatar_url": null, - "displayname": "example", - "membership": "join" - }, - "sender": "@example:localhost", - "state_key": "@example:localhost", - "type": "m.room.member", - }) -}); - -pub static NAME: Lazy = Lazy::new(|| { - json!({ - "content": { - "name": "room name" - }, - "event_id": "$15139375513VdeRF:localhost", - "origin_server_ts": 151393755, - "sender": "@example:localhost", - "state_key": "", - "type": "m.room.name", - "unsigned": { - "age": 703422 - } - }) -}); - -pub static NAME_STRIPPED: Lazy = Lazy::new(|| { - json!({ - "content": { - "name": "room name" - }, - "sender": "@example:localhost", - "state_key": "", - "type": "m.room.name", - }) -}); - -pub static POWER_LEVELS: Lazy = Lazy::new(|| { - json!({ - "content": { - "ban": 50, - "events": { - "m.room.avatar": 50, - "m.room.canonical_alias": 50, - "m.room.history_visibility": 100, - "m.room.name": 50, - "m.room.power_levels": 100, - "m.room.message": 25 - }, - "events_default": 0, - "invite": 0, - "kick": 50, - "redact": 50, - "state_default": 50, - "notifications": { - "room": 0 - }, - "users": { - "@example:localhost": 100, - "@bob:localhost": 0 - }, - "users_default": 0 - }, - "event_id": "$15139375512JaHAW:localhost", - "origin_server_ts": 151393755, - "sender": "@example:localhost", - "state_key": "", - "type": "m.room.power_levels", - "unsigned": { - "age": 703422 - } - }) -}); - -pub static PRESENCE: Lazy = Lazy::new(|| { - json!({ - "content": { - "avatar_url": "mxc://localhost/wefuiwegh8742w", - "currently_active": false, - "last_active_ago": 1, - "presence": "online", - "status_msg": "Making cupcakes" - }, - "sender": "@example:localhost", - "type": "m.presence" - }) -});