diff --git a/identity_iota_core/tests/e2e/identity.rs b/identity_iota_core/tests/e2e/identity.rs index 7075128d2..102dc3fe7 100644 --- a/identity_iota_core/tests/e2e/identity.rs +++ b/identity_iota_core/tests/e2e/identity.rs @@ -214,9 +214,14 @@ async fn can_get_historical_identity_data() -> anyhow::Result<()> { let versions: Vec = history.iter().map(|elem| elem.version).collect(); let version_numbers: Vec = versions.iter().map(|v| (*v).into()).collect(); - let oldest_version: usize = *version_numbers.last().unwrap(); - let version_diffs: Vec = version_numbers.iter().map(|v| v - oldest_version).collect(); - assert_eq!(version_diffs, vec![1, 0],); + + // Check that we have 2 versions (original and updated) + assert_eq!(version_numbers.len(), 2); + // Check that versions are in descending order (newest to oldest) + assert!( + version_numbers[0] > version_numbers[1], + "versions should be in descending order" + ); // paging: // you can either loop until no result is returned