(snapshot: &Value, selector: &ElementSelector)
| 723 | } |
| 724 | |
| 725 | fn snapshot_contains_element(snapshot: &Value, selector: &ElementSelector) -> bool { |
| 726 | snapshot |
| 727 | .get("roots") |
| 728 | .and_then(Value::as_array) |
| 729 | .map(|roots| { |
| 730 | roots |
| 731 | .iter() |
| 732 | .any(|root| node_contains_matching_element(root, selector)) |
| 733 | }) |
| 734 | .unwrap_or(false) |
| 735 | } |
| 736 | |
| 737 | fn node_contains_matching_element(node: &Value, selector: &ElementSelector) -> bool { |
| 738 | element_matches(node, selector) |
no test coverage detected