Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

react testing library

// Quickstart (Hello World) with React Testing Library:
import { render, screen } from '@testing-library/react';

test('should show login form', () => {
  render(<Login />); // Render the Component
  const input = screen.getByLabelText('Username');
  // Events and assertions....
  expect( input ).not.toBeDisabled();
});

// Shout-out to @andreas-assehn and @kelott for the suggestion. :)
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #react #testing #library
ADD COMMENT
Topic
Name
2+6 =