-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form.test.js
38 lines (28 loc) · 1.01 KB
/
Form.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react'
import '@testing-library/jest-dom'
import { render } from '@testing-library/react'
import { Provider } from 'react-redux'
import configureStore from 'redux-mock-store'
import { initialStateTestData } from '../../test-data'
import Form from './Form'
describe('Form', () => {
let FormComponent, store, mockStore, initialState
beforeEach(() => {
initialState = initialStateTestData
mockStore = configureStore()
store = mockStore(initialState)
FormComponent = render(
<Provider store={store}>
<Form />
</Provider>,
)
})
it('Dropdown should successfully display given options', () => {
const { getByText, getByTestId } = FormComponent
expect(getByTestId('search-input')).toBeInTheDocument()
expect(getByText('Filter by Genre')).toBeInTheDocument()
expect(getByText('Filter by State')).toBeInTheDocument()
expect(getByText('Filter by Attire')).toBeInTheDocument()
expect(getByText('clear all filters')).toBeInTheDocument()
})
})