From 3d6dce51ad34021460e08ab9d64cc84e9a34f37e Mon Sep 17 00:00:00 2001 From: Alfan Nur Fauzan Date: Tue, 24 Sep 2024 17:38:12 +0700 Subject: [PATCH] fix tests quranize wasm --- web-app/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web-app/src/lib.rs b/web-app/src/lib.rs index 5af1d83..530d822 100644 --- a/web-app/src/lib.rs +++ b/web-app/src/lib.rs @@ -138,7 +138,8 @@ mod tests { #[test] fn test_encode() { let q = JsQuranize::new(); - let l = &q.get_locations(&q.encode("bismillah")[0].quran)[0]; + let locs = &q.get_locations(&q.encode("bismillah")[0].quran); + let l = locs.iter().find(|l| l.sura_number == 1).unwrap(); assert_eq!(1, l.sura_number); assert_eq!(1, l.aya_number); assert_eq!("", l.before_text);