import { render, screen } from '@testing-library/react'; import App from './App'; import { fizzbuzz } from './utils'; describe('App test', () => { test('Should find a title and a button', () => { render(<App/>); const heading = screen.getByRole('heading', { level: 2, name: /Hello world/i }); expect(heading).toBeDefined(); const primaryButton = screen.getByRole('button', { name: /primary\/default/i }); expect(primaryButton).toBeDefined(); }); }); describe('Utils test', () => { test("should print 1 if receive 1", () => { const result = fizzbuzz(1); expect(1).toBe(result); }); });
Tests