import {render, screen} from '@testing-library/react'
import OmnisearchForm from '.'

describe('form for searching everything', () => {
	beforeEach(() => {
		render(
			<OmnisearchForm
				labels={{
					form: 'Search',
					query: 'Query',
				}}
			/>
		)
	})

	it('should render a form', () => {
		expect(screen.getByRole('form', { name: 'Search' })).toBeInTheDocument()
	})

	it('should render a textbox for the search query', () => {
		expect(screen.getByRole('textbox', { name: 'Query' })).toBeInTheDocument()
	})

	it('should render a button for submitting the search query', () => {
		expect(screen.getByRole('button', { name: 'Search' })).toBeInTheDocument()
	})
})
