Skip to content

Commit 03eed5a

Browse files
committed
Edit nesting error and don't use the same list
1 parent 5b373e6 commit 03eed5a

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

src/Components/forms/inputs/EmployerDropDown.test.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ describe('EmployerDropDown', () => {
3333
const user = userEvent.setup()
3434
render(
3535
<EmployerDropDown
36-
arrayList={employerList}
36+
arrayList={[
37+
{ name: 'Beamery', _id: 'Beamery' },
38+
{ name: 'American Express ', _id: 'American Express ' },
39+
{ name: 'Capgemini', _id: 'Capgemini' }
40+
]}
3741
employerOnChange={() => {}}
3842
isEmpty={false}
3943
/>
@@ -44,10 +48,10 @@ describe('EmployerDropDown', () => {
4448
expect(
4549
screen.getByRole('option', { name: /capgemini/i })
4650
).toBeInTheDocument()
51+
expect(
52+
screen.queryByRole('option', { name: /Carnall Farrar/i })
53+
).not.toBeInTheDocument()
4754
})
48-
expect(
49-
screen.queryByRole('option', { name: /Carnall Farrar/i })
50-
).not.toBeInTheDocument()
5155
it('finds characters within words', async () => {
5256
const user = userEvent.setup()
5357
render(
@@ -88,27 +92,27 @@ describe('EmployerDropDown', () => {
8892
expect(
8993
screen.queryByRole('option', { name: 'BBC' })
9094
).not.toBeInTheDocument()
91-
})
92-
expect(
93-
screen.queryByRole('option', { name: 'Blue Frontier' })
94-
).not.toBeInTheDocument()
95+
expect(
96+
screen.queryByRole('option', { name: 'Blue Frontier' })
97+
).not.toBeInTheDocument()
9598

96-
expect(
97-
screen.queryByRole('option', { name: 'Brandwatch' })
98-
).not.toBeInTheDocument()
99-
expect(
100-
screen.queryByRole('option', { name: 'EngineerBetter' })
101-
).not.toBeInTheDocument()
102-
expect(
103-
screen.queryByRole('option', { name: 'Equal Experts' })
104-
).not.toBeInTheDocument()
105-
expect(
106-
screen.queryByRole('option', { name: 'Infobip' })
107-
).not.toBeInTheDocument()
108-
expect(
109-
screen.queryByRole('option', { name: 'Synaptik Digital' })
110-
).not.toBeInTheDocument()
111-
expect(
112-
screen.queryByRole('option', { name: 'Tata Consultancy services' })
113-
).not.toBeInTheDocument()
99+
expect(
100+
screen.queryByRole('option', { name: 'Brandwatch' })
101+
).not.toBeInTheDocument()
102+
expect(
103+
screen.queryByRole('option', { name: 'EngineerBetter' })
104+
).not.toBeInTheDocument()
105+
expect(
106+
screen.queryByRole('option', { name: 'Equal Experts' })
107+
).not.toBeInTheDocument()
108+
expect(
109+
screen.queryByRole('option', { name: 'Infobip' })
110+
).not.toBeInTheDocument()
111+
expect(
112+
screen.queryByRole('option', { name: 'Synaptik Digital' })
113+
).not.toBeInTheDocument()
114+
expect(
115+
screen.queryByRole('option', { name: 'Tata Consultancy services' })
116+
).not.toBeInTheDocument()
117+
})
114118
})

0 commit comments

Comments
 (0)