Sha256: f15952e5822c87789b630fe8309751b58385b3ad4407ebea592a25504489fd9d
Contents?: true
Size: 985 Bytes
Versions: 14
Compression:
Stored size: 985 Bytes
Contents
import React from 'react'; import { render, fireEvent, screen } from '@testing-library/react'; import { SearchSelect } from '../SearchSelect'; const apiKey = 'HOSTS_KEY'; describe('SearchSelect', () => { it('too many', () => { const onSearch = jest.fn(); const setLabel = jest.fn(); render( <SearchSelect selected={['hosts1,host2']} setSelected={jest.fn()} apiKey={apiKey} url="/hosts" placeholderText="Test hosts" useNameSearch={() => [ onSearch, { results: ['host1', 'host2', 'host3'], subtotal: 101 }, false, ]} setLabel={setLabel} /> ); const openSelectbutton = screen.getByRole('button', { name: 'typeahead select toggle', }); fireEvent.click(openSelectbutton); const tooMany = screen.queryAllByText( 'You have %s results to display. Showing first %s results + 101 + 100' ); expect(tooMany).toHaveLength(1); }); });
Version data entries
14 entries across 14 versions & 1 rubygems