Skip to content
Closed
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
14 changes: 7 additions & 7 deletions src/ReactTestingLibrary.re
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ external _debug : Js.undefined(Dom.element) => unit = "debug";
external rerender : ReasonReact.reactElement => unit = "";

let getByAltText = (string, result) =>
getByAltText(string, result |> container);
getByAltText(string, result |> baseElement);

let getByPlaceholderText = (string, result) =>
getByPlaceholderText(string, result |> container);
getByPlaceholderText(string, result |> baseElement);

let getByTestId = (string, result) =>
getByTestId(string, result |> container);
getByTestId(string, result |> baseElement);

let getByText = (~matcher, ~options=?, result) =>
getByText(~matcher, ~options=?options, result |> container);
getByText(~matcher, ~options=?options, result |> baseElement);

let getByLabelText = (~matcher, ~options=?, result) =>
getByLabelText(~matcher, ~options=?options, result |> container);
getByLabelText(~matcher, ~options=?options, result |> baseElement);

let getByTitle = (string, result) => getByTitle(string, result |> container);
let getByTitle = (string, result) => getByTitle(string, result |> baseElement);

let getByDisplayValue = (string, result) => getByDisplayValue(string, result |> container);
let getByDisplayValue = (string, result) => getByDisplayValue(string, result |> baseElement);

let render = (~baseElement=?, ~container=?, element) => {
let baseElement_ =
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/ReactTestingLibrary_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ describe("ReactTestingLibrary", () => {
</div>
);

afterEach(() => {
cleanup();
});

test("render works", () => {
element
|> render
Expand Down