import { render } from 'utils/testRenderer'; import { UpdateCount } from './UpdateCount'; import { screen } from '@testing-library/react'; test('Show only features count when no segments', async () => { render(); expect(screen.getByText('1 feature toggle')).toBeInTheDocument(); expect(screen.queryByText('0 segments')).not.toBeInTheDocument(); }); test('Show features and segments count', async () => { render(); expect(screen.getByText('0 feature toggles')).toBeInTheDocument(); expect(screen.getByText('1 segment')).toBeInTheDocument(); }); test('Show features and segments plural count', async () => { render(); expect(screen.getByText('2 feature toggles')).toBeInTheDocument(); expect(screen.getByText('3 segments')).toBeInTheDocument(); });