Sha256: 8d72164c36abe016147a8d33b3d565e8679b47f17b7eb0ae8c5c1c45ae7db78d
Contents?: true
Size: 696 Bytes
Versions: 77
Compression:
Stored size: 696 Bytes
Contents
import React from 'react'; import { renderWithRouter } from 'react-testing-lib-wrapper'; import { head } from 'lodash'; import RoutedTabs from '../'; const tabs = [ { key: 'apples', title: 'Apples', content: <>good for pies!</>, path: '/fruits', }, { key: 'pears', title: 'Pears', content: <>good for a snack!</>, path: '/fruits', }, ]; test('can render tabs and show default tab', async () => { const { getAllByLabelText, getByText } = renderWithRouter(<RoutedTabs tabs={tabs} baseUrl="/fruits" defaultTabIndex={1} />); expect(head(getAllByLabelText('Pears'))).toBeInTheDocument(); expect(getByText('good for a snack!')).toBeInTheDocument(); });
Version data entries
77 entries across 77 versions & 1 rubygems