Skip to content

Commit 7adf60d

Browse files
BillCarsonFrpoljar
authored andcommitted
fixup: Cleaner ProcessedToDevice snapshot serialization
1 parent bd576c2 commit 7adf60d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/matrix-sdk-crypto/src/machine/tests/send_encrypted_to_device.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ async fn test_processed_to_device_variants() {
219219

220220
insta::with_settings!({ prepend_module_to_snapshot => false }, {
221221
assert_json_snapshot!(
222-
serde_json::from_str::<Value>(processed_event.to_raw().json().get()).unwrap(),
222+
processed_event.to_raw().deserialize_as::<Value>().unwrap(),
223223
{
224224
".keys.ed25519" => "[sender_ed25519_key]",
225225
r#"["org.matrix.msc4147.device_keys"].device_id"# => "[ABCDEFGH]",
@@ -237,7 +237,7 @@ async fn test_processed_to_device_variants() {
237237

238238
insta::with_settings!({ prepend_module_to_snapshot => false }, {
239239
assert_json_snapshot!(
240-
serde_json::from_str::<Value>(processed_event.to_raw().json().get()).unwrap(),
240+
processed_event.to_raw().deserialize_as::<Value>().unwrap(),
241241
);
242242
});
243243

@@ -246,7 +246,7 @@ async fn test_processed_to_device_variants() {
246246

247247
insta::with_settings!({ prepend_module_to_snapshot => false }, {
248248
assert_json_snapshot!(
249-
serde_json::from_str::<Value>(processed_event.to_raw().json().get()).unwrap(),
249+
processed_event.to_raw().deserialize_as::<Value>().unwrap(),
250250
);
251251
});
252252

@@ -255,7 +255,7 @@ async fn test_processed_to_device_variants() {
255255

256256
insta::with_settings!({ prepend_module_to_snapshot => false }, {
257257
assert_json_snapshot!(
258-
serde_json::from_str::<Value>(processed_event.to_raw().json().get()).unwrap(),
258+
processed_event.to_raw().deserialize_as::<Value>().unwrap(),
259259
{
260260
".content.sender_key" => "[sender_ed25519_key]",
261261
".content.ciphertext" => "[++REDACTED++]",

0 commit comments

Comments
 (0)