fix tests

This commit is contained in:
mpostma
2020-12-15 12:05:17 +01:00
parent 2904ca7f57
commit 6eb7843858
5 changed files with 28 additions and 69 deletions

View File

@ -132,6 +132,8 @@ async fn get_dump_status_should_return_done() {
let (value, status_code) = server.trigger_dump().await;
println!("value: {:#?}", value);
assert_eq!(status_code, 202);
let dump_uid = value["uid"].as_str().unwrap().to_string();
@ -367,20 +369,10 @@ async fn dump_index_updates_should_be_valid() {
compression::from_tar_gz(&dumps_dir.join(&format!("{}.dump", uid)), tmp_dir_path).unwrap();
let file = File::open(tmp_dir_path.join("test").join("updates.jsonl")).unwrap();
let mut updates = read_all_jsonline(file);
let updates = read_all_jsonline(file);
// hotfix until #943 is fixed (https://github.com/meilisearch/MeiliSearch/issues/943)
updates.as_array_mut().unwrap()
.get_mut(0).unwrap()
.get_mut("type").unwrap()
.get_mut("settings").unwrap()
.get_mut("displayed_attributes").unwrap()
.get_mut("Update").unwrap()
.as_array_mut().unwrap().sort_by(|a, b| a.as_str().cmp(&b.as_str()));
eprintln!("{}\n", updates.to_string());
eprintln!("{}", expected.to_string());
eprintln!("{}\n", updates);
eprintln!("{}", expected);
assert_json_include!(expected: expected, actual: updates);
}