Skip to content

Commit f7ae758

Browse files
committed
change the component test name
1 parent 08f5442 commit f7ae758

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

src/Components/forms/inputs/AutoFillDropDown.test.js renamed to src/Components/forms/inputs/EmployerDropDown.test.js

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,36 @@
1-
import '@testing-library/jest-dom' // this should go in ./src/setupTests.js
1+
import '@testing-library/jest-dom'
22
import { render, screen } from '@testing-library/react'
33
import userEvent from '@testing-library/user-event'
44
import exampleData from '../data.json'
5-
import AutoFillDropDown from './AutoFillDropDown'
5+
import EmployerDropDown from './EmployerDropDown'
66

7-
describe('AutoFillDropDown', () => {
8-
describe('AutoFillDropDown', () => {
9-
it('shows a matching option for specific word', async () => {
10-
const user = userEvent.setup()
11-
render(
12-
<AutoFillDropDown
13-
arrayList={exampleData.employerList}
14-
employerOnChange={() => {}}
15-
isEmpty={false}
16-
label="Employer"
17-
name="employer"
18-
/>
19-
)
7+
describe('EmployerDropDown', () => {
8+
it('shows a matching option for specific word', async () => {
9+
const user = userEvent.setup()
10+
render(
11+
<EmployerDropDown
12+
arrayList={exampleData.employerList}
13+
employerOnChange={() => {}}
14+
isEmpty={false}
15+
/>
16+
)
2017

21-
await user.type(
22-
screen.getByRole('textbox', { name: /employer/i }),
23-
'capgemini'
24-
)
18+
await user.type(screen.getByRole('textbox', { name: /employer/i }), 'cap')
2519

26-
expect(
27-
screen.getByRole('option', { name: /capgemini/i })
28-
).toBeInTheDocument()
29-
})
3020
expect(
31-
screen.queryByRole('option', { name: /Carnall Farrar/i })
32-
).not.toBeInTheDocument()
21+
screen.getByRole('option', { name: /capgemini/i })
22+
).toBeInTheDocument()
3323
})
24+
expect(
25+
screen.queryByRole('option', { name: /Carnall Farrar/i })
26+
).not.toBeInTheDocument()
3427
it('finds characters within words', async () => {
3528
const user = userEvent.setup()
3629
render(
37-
<AutoFillDropDown
30+
<EmployerDropDown
3831
arrayList={exampleData.employerList}
3932
employerOnChange={() => {}}
4033
isEmpty={false}
41-
name="employer"
42-
label="Employer"
4334
/>
4435
)
4536

0 commit comments

Comments
 (0)