@@ -125,9 +125,8 @@ describe('SearchBar', () => {
125
125
</ EnvelopesProvider >
126
126
)
127
127
128
- expect ( getAllByRole ( 'checkbox' ) ) . to . have . length ( 3 )
128
+ expect ( getAllByRole ( 'checkbox' ) ) . to . have . length ( 2 )
129
129
expect ( getByRole ( 'checkbox' , { name : 'passed 5' } ) ) . to . be . visible
130
- expect ( getByRole ( 'checkbox' , { name : 'undefined 2' } ) ) . to . be . visible
131
130
expect ( getByRole ( 'checkbox' , { name : 'failed 2' } ) ) . to . be . visible
132
131
getAllByRole ( 'checkbox' ) . forEach ( ( checkbox : HTMLInputElement ) => {
133
132
expect ( checkbox ) . to . be . checked
@@ -142,26 +141,25 @@ describe('SearchBar', () => {
142
141
</ EnvelopesProvider >
143
142
)
144
143
145
- await userEvent . click ( getByRole ( 'checkbox' , { name : 'undefined 2' } ) )
144
+ await userEvent . click ( getByRole ( 'checkbox' , { name : 'failed 2' } ) )
146
145
147
146
expect ( onChange ) . to . have . been . calledOnceWithExactly ( {
148
147
query : '' ,
149
- hideStatuses : [ TestStepResultStatus . UNDEFINED ] ,
148
+ hideStatuses : [ TestStepResultStatus . FAILED ] ,
150
149
} )
151
150
} )
152
151
153
152
it ( 'should show hidden statuses as unchecked' , ( ) => {
154
153
const { getByRole } = render (
155
154
< EnvelopesProvider envelopes = { examplesTablesFeature } >
156
155
< TestableSearchBar
157
- defaultValue = { { query : '' , hideStatuses : [ TestStepResultStatus . UNDEFINED ] } }
156
+ defaultValue = { { query : '' , hideStatuses : [ TestStepResultStatus . FAILED ] } }
158
157
/>
159
158
</ EnvelopesProvider >
160
159
)
161
160
162
161
expect ( getByRole ( 'checkbox' , { name : 'passed 5' } ) ) . to . be . checked
163
- expect ( getByRole ( 'checkbox' , { name : 'failed 2' } ) ) . to . be . checked
164
- expect ( getByRole ( 'checkbox' , { name : 'undefined 2' } ) ) . not . to . be . checked
162
+ expect ( getByRole ( 'checkbox' , { name : 'failed 2' } ) ) . not . to . be . checked
165
163
} )
166
164
167
165
it ( 'updates the search context when a status is rechecked' , async ( ) => {
@@ -171,7 +169,7 @@ describe('SearchBar', () => {
171
169
< TestableSearchBar
172
170
defaultValue = { {
173
171
query : '' ,
174
- hideStatuses : [ TestStepResultStatus . FAILED , TestStepResultStatus . UNDEFINED ] ,
172
+ hideStatuses : [ TestStepResultStatus . FAILED , TestStepResultStatus . PASSED ] ,
175
173
} }
176
174
onChange = { onChange }
177
175
/>
@@ -182,7 +180,7 @@ describe('SearchBar', () => {
182
180
183
181
expect ( onChange ) . to . have . been . calledOnceWithExactly ( {
184
182
query : '' ,
185
- hideStatuses : [ TestStepResultStatus . UNDEFINED ] ,
183
+ hideStatuses : [ TestStepResultStatus . PASSED ] ,
186
184
} )
187
185
} )
188
186
} )
0 commit comments