Skip to content

Commit d5253a2

Browse files
refactor(dom): rename BoundFunctions to BoundQueries (#40)
1 parent 35ec0c7 commit d5253a2

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/dom/src/get_queries_for_element.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ use crate::{
77
types::{Matcher, MatcherOptions, SelectorMatcherOptions, WaitForOptions},
88
};
99

10-
pub fn get_queries_for_element(element: HtmlElement) -> BoundFunctions {
11-
BoundFunctions { element }
10+
pub fn get_queries_for_element(element: HtmlElement) -> BoundQueries {
11+
BoundQueries { element }
1212
}
1313

14-
pub struct BoundFunctions {
14+
pub struct BoundQueries {
1515
element: HtmlElement,
1616
}
1717

1818
macro_rules! queries_for_element {
1919
($(($name:ident, $matcher_type:ty, $options_type:ty)),*,) => {
2020
paste::paste! {
21-
impl BoundFunctions {
21+
impl BoundQueries {
2222
$(pub async fn [< find_by_ $name >]<M: Into<$matcher_type>>(
2323
&self,
2424
matcher: M,

packages/dom/src/screen.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use std::ops::Deref;
22

33
use web_sys::window;
44

5-
use crate::{BoundFunctions, DocumentOrElement, get_queries_for_element, log_dom};
5+
use crate::{BoundQueries, DocumentOrElement, get_queries_for_element, log_dom};
66

7-
pub struct Screen(BoundFunctions);
7+
pub struct Screen(BoundQueries);
88

99
impl Screen {
1010
pub fn debug(&self, elements: Option<Vec<DocumentOrElement>>, max_length: Option<usize>) {
@@ -19,7 +19,7 @@ impl Screen {
1919
}
2020

2121
impl Deref for Screen {
22-
type Target = BoundFunctions;
22+
type Target = BoundQueries;
2323

2424
fn deref(&self) -> &Self::Target {
2525
&self.0

packages/dom/tests/helpers/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use testing_library_dom::{BoundFunctions, get_queries_for_element};
1+
use testing_library_dom::{BoundQueries, get_queries_for_element};
22
use wasm_bindgen::JsCast;
33
use web_sys::{Document, HtmlElement, window};
44

@@ -11,7 +11,7 @@ pub fn document() -> Document {
1111

1212
pub struct RenderReturn {
1313
pub container: HtmlElement,
14-
pub container_queries: BoundFunctions,
14+
pub container_queries: BoundQueries,
1515
pub rerender: Box<dyn Fn(&str) -> RenderReturn>,
1616
}
1717

0 commit comments

Comments
 (0)