`
);
});
it("creates a dom tree for an element with a role button", () => {
replaceQueries({
getByRole,
}).getByRole(container, "button");
expect(document.body.innerHTML.toLowerCase()).toBe(
`
`
);
});
it("creates a dom tree for an element with a role button and a name", () => {
replaceQueries({
getByRole,
}).getByRole(container, "button", { name: /submit/i });
expect(document.body.innerHTML.toLowerCase()).toBe(
`
submit
`
);
});
});
describe("getByLabelText", () => {
it("creates a dom tree for an element with a label with text", () => {
const element = replaceQueries({
getByLabelText,
}).getByLabelText(container, /username/i);
expect(element.outerHTML.toLowerCase()).toEqual(``);
expect(document.body.innerHTML.toLowerCase()).toBe(
`
`
);
});
});
describe("getByText", () => {
it("creates a dom tree for an element with a text", () => {
const element = replaceQueries({
getByText,
}).getByText(container, /some text/i);
expect(element.outerHTML.toLowerCase()).toEqual(`