Skip to content

Commit

Permalink
Add test for statusListIndex serialization in StatusList2021Entry
Browse files Browse the repository at this point in the history
  • Loading branch information
itsyaasir committed Nov 12, 2024
1 parent ac9d2ed commit b5e19dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions identity_credential/src/revocation/status_list_2021/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,13 @@ mod tests {
});
serde_json::from_value::<StatusList2021Entry>(status).expect("wrong type");
}

#[test]
fn test_status_list_index_serialization() {
let base_url = Url::parse("https://example.com/credentials/status/3").unwrap();

let entry1 = StatusList2021Entry::new(base_url.clone(), StatusPurpose::Revocation, 94567, None);
let json1 = serde_json::to_value(&entry1).unwrap();
assert_eq!(json1["statusListIndex"], "94567");
}
}

0 comments on commit b5e19dc

Please sign in to comment.