Skip to content

Commit 7a06bdb

Browse files
authored
Rename snapshots to reduce filename length (#4625)
1 parent 6c57003 commit 7a06bdb

6 files changed

+16
-6
lines changed

crates/matrix-sdk-crypto/src/session_manager/group_sessions/share_strategy.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ mod tests {
676676

677677
use assert_matches::assert_matches;
678678
use assert_matches2::assert_let;
679-
use insta::assert_snapshot;
679+
use insta::{assert_snapshot, with_settings};
680680
use matrix_sdk_common::deserialized_responses::WithheldCode;
681681
use matrix_sdk_test::{
682682
async_test, test_json,
@@ -746,7 +746,9 @@ mod tests {
746746
fn test_serialize_device_based_strategy() {
747747
let encryption_settings = all_devices_strategy_settings();
748748
let serialized = serde_json::to_string(&encryption_settings).unwrap();
749-
assert_snapshot!(serialized);
749+
with_settings!({prepend_module_to_snapshot => false}, {
750+
assert_snapshot!(serialized)
751+
});
750752
}
751753

752754
/// [`CollectStrategy::AllDevices`] used to be known as
@@ -1340,7 +1342,9 @@ mod tests {
13401342
.with_dehydrated_device(bob_dehydrated_device_id, true)
13411343
.build_response();
13421344
allow_duplicates! {
1343-
with_settings!({sort_maps => true}, { assert_json_snapshot!(ruma_response_to_json(keys_query.clone())) });
1345+
with_settings!({ sort_maps => true, prepend_module_to_snapshot => false }, {
1346+
assert_json_snapshot!(ruma_response_to_json(keys_query.clone()))
1347+
});
13441348
}
13451349
machine.mark_request_as_sent(&TransactionId::new(), &keys_query).await.unwrap();
13461350

@@ -1394,7 +1398,9 @@ mod tests {
13941398
.with_dehydrated_device(bob_dehydrated_device_id, false)
13951399
.build_response();
13961400
allow_duplicates! {
1397-
with_settings!({sort_maps => true}, { assert_json_snapshot!(ruma_response_to_json(keys_query.clone())) });
1401+
with_settings!({ sort_maps => true, prepend_module_to_snapshot => false }, {
1402+
assert_json_snapshot!(ruma_response_to_json(keys_query.clone()))
1403+
});
13981404
}
13991405
machine.mark_request_as_sent(&TransactionId::new(), &keys_query).await.unwrap();
14001406

@@ -1460,7 +1466,9 @@ mod tests {
14601466
.with_dehydrated_device(bob_dehydrated_device_id, true)
14611467
.build_response();
14621468
allow_duplicates! {
1463-
with_settings!({sort_maps => true}, { assert_json_snapshot!(ruma_response_to_json(keys_query.clone())) });
1469+
with_settings!({ sort_maps => true, prepend_module_to_snapshot => false }, {
1470+
assert_json_snapshot!(ruma_response_to_json(keys_query.clone()))
1471+
});
14641472
}
14651473
machine.mark_request_as_sent(&TransactionId::new(), &keys_query).await.unwrap();
14661474

@@ -1589,7 +1597,9 @@ mod tests {
15891597
.with_dehydrated_device(bob_dehydrated_device_id, true)
15901598
.build_response();
15911599
allow_duplicates! {
1592-
with_settings!({sort_maps => true}, { assert_json_snapshot!(ruma_response_to_json(keys_query.clone())) });
1600+
with_settings!({ sort_maps => true, prepend_module_to_snapshot => false }, {
1601+
assert_json_snapshot!(ruma_response_to_json(keys_query.clone()))
1602+
});
15931603
}
15941604
machine.mark_request_as_sent(&TransactionId::new(), &keys_query).await.unwrap();
15951605

0 commit comments

Comments
 (0)