SHARE
TWEET

Untitled

a guest Apr 20th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. test("it should render card with paid course", () => {
  2.   const component = render(
  3.     <Router>
  4.       <CourseCard {...courses[1]} />
  5.     </Router>
  6.   );
  7.  
  8.   expect(component.getByText("Curso pago")).toBeTruthy();
  9.   expect(component.getByText("Preço: R$ 100")).toBeTruthy();
  10.   expect(component.getByText("Lorem ipsum dolor sit amet.")).toBeTruthy();
  11.   expect(component.getByText(/saber mais/i)).toBeTruthy();
  12.   expect(component.getByText(/comprar/i)).toBeTruthy();
  13. });
  14.  
  15. test("it should render card with user subscription", () => {
  16.   const component = render(<CourseCard {...courses[2]} />);
  17.  
  18.   expect(component.getByText("Curso pago com inscrição")).toBeTruthy();
  19.   expect(component.getByText("Progresso: 33%")).toBeTruthy();
  20.   expect(component.getByText("Lorem ipsum dolor sit amet.")).toBeTruthy();
  21.   expect(component.getByText(/continuar/i)).toBeTruthy();
  22. });
  23.  
  24. test("it should render card with inactive course", () => {
  25.   const component = render(<CourseCard {...courses[3]} />);
  26.  
  27.   expect(component.getByText("Curso a ser lançado")).toBeTruthy();
  28.   expect(component.getByText("Em breve...")).toBeTruthy();
  29.   expect(component.getByText("Lorem ipsum dolor sit amet.")).toBeTruthy();
  30.   expect(component.getByText(/saber mais/i)).toBeTruthy();
  31. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top