@@ -14,12 +14,12 @@ describe('EmployerDropDown', () => {
14
14
{ name : 'American Express' , _id : 'American Express ' } ,
15
15
{ name : 'Capgemini' , _id : 'Capgemini' }
16
16
] }
17
- employerOnChange = { ( ) => { } }
17
+ onChange = { ( ) => { } }
18
18
isEmpty = { false }
19
19
/>
20
20
)
21
21
expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent (
22
- 'Who is your employer?'
22
+ 'Who is your employer? * '
23
23
)
24
24
expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent (
25
25
'Type your employer name here'
@@ -34,7 +34,7 @@ describe('EmployerDropDown', () => {
34
34
{ name : 'Capgemini' , _id : 'Capgemini' } ,
35
35
{ name : 'Carnall Farrar' , _id : 'Carnall Farrar' }
36
36
] }
37
- employerOnChange = { ( ) => { } }
37
+ onChange = { ( ) => { } }
38
38
isEmpty = { false }
39
39
/>
40
40
)
@@ -56,15 +56,16 @@ describe('EmployerDropDown', () => {
56
56
{ name : 'Beamery' , _id : 'Beamery' } ,
57
57
{ name : 'American Express ' , _id : 'American Express ' } ,
58
58
{ name : 'Capgemini' , _id : 'Capgemini' } ,
59
- { name : 'Capnga ' , _id : 'Capnga ' }
59
+ { name : 'Capital ' , _id : 'Capital ' }
60
60
] }
61
- employerOnChange = { ( ) => { } }
61
+ onChange = { ( ) => { } }
62
62
isEmpty = { false }
63
- />
63
+ /> ,
64
+ { hidden : true }
64
65
)
65
66
await user . type ( screen . getByRole ( 'combobox' , { id : 'employer' } ) , 'cap' )
66
67
expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( 'Capgemini' )
67
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( 'Capnga ' )
68
+ expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( 'Capital ' )
68
69
expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent ( 'Beamery' )
69
70
} )
70
71
it ( 'finds characters within words' , async ( ) => {
@@ -102,47 +103,40 @@ describe('EmployerDropDown', () => {
102
103
] }
103
104
employerOnChange = { ( ) => { } }
104
105
isEmpty = { false }
105
- />
106
- )
107
- await user . type ( screen . getByRole ( 'combobox' , { id : 'employer' } ) , 'am' )
108
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( 'Amazon' )
109
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent (
110
- 'Amazon Web Services (AWS)'
111
- )
112
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent (
113
- 'American Express'
114
- )
115
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( 'Beamery' )
116
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent (
117
- 'Blueprint Gaming'
118
- )
119
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( 'EPAM System' )
120
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent (
121
- 'Inspired Gaming Group'
122
- )
123
- expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( 'Tamarix Tech' )
124
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent (
125
- 'Alpha FX Group'
126
- )
127
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent ( 'Anaplan' )
128
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent ( 'BBC' )
129
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent ( 'Bet365' )
130
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent (
131
- 'Blue Frontier'
132
- )
133
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent ( 'Brandwatch' )
134
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent (
135
- 'EngineerBetter'
136
- )
137
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent (
138
- 'Equal Experts'
139
- )
140
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent ( 'Infobip' )
141
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent (
106
+ /> ,
107
+ { hidden : true }
108
+ )
109
+ const appearingEmployers = [
110
+ 'Amazon' ,
111
+ 'Amazon Web Services (AWS)' ,
112
+ 'American Express' ,
113
+ 'Beamery' ,
114
+ 'Blueprint Gaming' ,
115
+ 'EPAM System' ,
116
+ 'Inspired Gaming Group' ,
117
+ 'Tamarix Tech'
118
+ ]
119
+ const notAppearingApplicants = [
120
+ 'Alpha FX Group' ,
121
+ 'Anaplan' ,
122
+ 'BBC' ,
123
+ 'Bet365' ,
124
+ 'Brandwatch' ,
125
+ 'Blue Frontier' ,
126
+ 'EngineerBetter' ,
127
+ 'Equal Experts' ,
128
+ 'Infobip' ,
129
+ 'Tata Consultancy services' ,
142
130
'Synaptik Digital'
131
+ ]
132
+
133
+ await user . type ( screen . getByRole ( 'combobox' , { id : 'employer' } ) , 'am' )
134
+
135
+ appearingEmployers . forEach ( employer =>
136
+ expect ( screen . getByTestId ( 'form-group' ) ) . toHaveTextContent ( employer )
143
137
)
144
- expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent (
145
- 'Tata Consultancy services'
138
+ notAppearingApplicants . forEach ( employer =>
139
+ expect ( screen . getByTestId ( 'form-group' ) ) . not . toHaveTextContent ( employer )
146
140
)
147
141
} )
148
142
} )
0 commit comments