import React from 'react'; import { render, screen } from '@testing-library/react'; import { Navigation } from './'; import { NavigationItem } from '../NavigationItem'; describe('Navigation component', () => { describe('given default props', () => { it('should display the children', () => { render( , , , ); expect(screen.getByText('Link 1')).toBeVisible(); expect(screen.getByText('Link 2')).toBeVisible(); }); }); describe('given a `className` props', () => { it(`should add it to the component's classnames`, () => { render( , ); expect( screen.getByRole('navigation', { name: 'Sub navigation' }), ).toHaveClass('MyNavigation'); }); }); });