- Why I'm Writing this book
- Who is this book for
- Author's Note
- Goals of this book
- Shoutouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { render, within } from "@testing-library/react"; | |
it("testing things", () => { | |
const { container } = render( | |
<Component prop={someProp} /> | |
); | |
const { getByText } = within(container.querySelector(".some-class")); | |
const getParent = getByText("2010").parentElement; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { render, cleanup } from "@testing-library/react"; | |
import MyComponent from "../MyComponent"; | |
afterEach(cleanup); | |
it("expects it to test something", () => { | |
const { debug } = render(<MyComponent />); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header> | |
<nav> | |
<ul> | |
<li><a href="http://"></a></li> | |
<li><a href="http://"></a></li> | |
<li><a href="http://"></a></li> | |
</ul> | |
</nav> | |
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Title of the document</title> | |
</head> | |
<body> | |
<button id="button"> | |
Open | |
</button> | |
<script src="script.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Title of the document</title> | |
</head> | |
<body> | |
<!--This doesn't work when you press Enter and | |
there's a click event --> | |
<div id="button-1" role="button" tabindex="0"> | |
Open |
NewerOlder