Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: init test for atelier 2 #1

Open
wants to merge 1 commit into
base: atelier-2
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions src/__tests__/exercice-02.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import BookList from "../features/book-list/BookList";

it("shows a list of books", () => {
render(<BookList />);

expect(screen.getByText(/Corbin Ritchie/)).toBeInTheDocument();
expect(screen.getByText(/Deonte Effertz/)).toBeInTheDocument();
expect(screen.getByText(/Dr. Abel Gutmann IV/)).toBeInTheDocument();
expect(screen.getByText(/Prof. Scotty Pfannerstill DVM/)).toBeInTheDocument();
expect(screen.getByText(/Ms. Alana Murphy/)).toBeInTheDocument();
});
2 changes: 2 additions & 0 deletions src/features/book-list/BookList.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from 'react'

const books = [
{isbn: '9793083416011', title: 'Excepturi explicabo volu…am aut voluptate velit.', author: 'Corbin Ritchie'},
{isbn: '9786451149666', title: 'Est est et eveniet porro non.', author: 'Deonte Effertz'},
Expand Down