Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/dom/src/get_queries_for_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ use crate::{
types::{Matcher, MatcherOptions, SelectorMatcherOptions, WaitForOptions},
};

pub fn get_queries_for_element(element: HtmlElement) -> BoundFunctions {
BoundFunctions { element }
pub fn get_queries_for_element(element: HtmlElement) -> BoundQueries {
BoundQueries { element }
}

pub struct BoundFunctions {
pub struct BoundQueries {
element: HtmlElement,
}

macro_rules! queries_for_element {
($(($name:ident, $matcher_type:ty, $options_type:ty)),*,) => {
paste::paste! {
impl BoundFunctions {
impl BoundQueries {
$(pub async fn [< find_by_ $name >]<M: Into<$matcher_type>>(
&self,
matcher: M,
Expand Down
6 changes: 3 additions & 3 deletions packages/dom/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use std::ops::Deref;

use web_sys::window;

use crate::{BoundFunctions, DocumentOrElement, get_queries_for_element, log_dom};
use crate::{BoundQueries, DocumentOrElement, get_queries_for_element, log_dom};

pub struct Screen(BoundFunctions);
pub struct Screen(BoundQueries);

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

impl Deref for Screen {
type Target = BoundFunctions;
type Target = BoundQueries;

fn deref(&self) -> &Self::Target {
&self.0
Expand Down
4 changes: 2 additions & 2 deletions packages/dom/tests/helpers/test_utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use testing_library_dom::{BoundFunctions, get_queries_for_element};
use testing_library_dom::{BoundQueries, get_queries_for_element};
use wasm_bindgen::JsCast;
use web_sys::{Document, HtmlElement, window};

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

pub struct RenderReturn {
pub container: HtmlElement,
pub container_queries: BoundFunctions,
pub container_queries: BoundQueries,
pub rerender: Box<dyn Fn(&str) -> RenderReturn>,
}

Expand Down