mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-30 02:07:10 +01:00
Web tests: assert the browser drop counts without explicit panics
This commit is contained in:
1 parent
ed7a50825f
commit
52553034cc
1 file changed
+4
-3
@@ -78,9 +78,10 @@ mod tests {
|
||||
ctx.run_ui(next, |ui| delivered.extend(drops.take(ui.ctx(), &position))).textures_delta.clear();
|
||||
|
||||
assert_eq!(shared_files.load(Ordering::Relaxed), 0, "the shared router must not see browser-owned drops");
|
||||
let [batch] = delivered.as_slice() else { panic!("the browser UI must receive exactly one batch") };
|
||||
let [file] = batch.files.as_slice() else { panic!("the browser UI must receive exactly one file") };
|
||||
assert!(Arc::ptr_eq(file, &svg));
|
||||
assert_eq!(delivered.len(), 1, "the browser UI must receive exactly one batch");
|
||||
let batch = &delivered[0];
|
||||
assert_eq!(batch.files.len(), 1, "the browser UI must receive exactly one file");
|
||||
assert!(Arc::ptr_eq(&batch.files[0], &svg));
|
||||
assert_eq!((batch.pos, batch.shift), (expected_pos, expected_shift));
|
||||
assert!(position.get().is_none());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user