Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ X N J
- import server from "miragejs/src/server"
- test("it fetches todos from the server", async () => {
- server.db.loadData({
- todos: [{ 1d: 1, text: "Write more tests!" }],
- )
- let { findByTestId, findByDisplayValue } = render(<TodoApp />)
- let todo = await findByTestId("todo-id-1")
- let input = await findByDisplayValue("Write more tests!")
- expect(todo).toBeInTheDocument( )
- expect(input).toBeInTheDocument( )
- )
Advertisement
Add Comment
Please, Sign In to add comment