@@ -118,28 +118,6 @@ describe('JobsList', () => {
118118 await fireEvent . click ( clearFiltersBtn ) ;
119119 }
120120
121- it ( 'refresh jobs' , async ( ) => {
122- const jobUpdater = function ( ) {
123- return data . jobs . map ( ( j ) => ( j . status === 'running' ? { ...j , status : 'done' } : j ) ) ;
124- } ;
125- const result = render ( JobsList , {
126- props : { jobUpdater }
127- } ) ;
128- let table = result . getByRole ( 'table' ) ;
129- expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 3 ) ;
130- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 0 ] . textContent ) . eq ( 'running' ) ;
131- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 0 ] . textContent ) . eq ( 'failed' ) ;
132- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 0 ] . textContent ) . eq ( 'done' ) ;
133-
134- const refreshButton = result . getByRole ( 'button' , { name : 'Refresh' } ) ;
135- await fireEvent . click ( refreshButton ) ;
136-
137- table = result . getByRole ( 'table' ) ;
138- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 0 ] . textContent ) . eq ( 'done' ) ;
139- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 0 ] . textContent ) . eq ( 'failed' ) ;
140- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 0 ] . textContent ) . eq ( 'done' ) ;
141- } ) ;
142-
143121 it ( 'cancel job' , async ( ) => {
144122 const nop = function ( ) { } ;
145123 const result = render ( JobsList , {
@@ -190,19 +168,19 @@ describe('JobsList', () => {
190168 } ) ;
191169 let table = result . getByRole ( 'table' ) ;
192170 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 3 ) ;
193- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 0 ] . textContent ) . eq ( 'running' ) ;
194- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 0 ] . textContent ) . eq ( 'failed' ) ;
195- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 0 ] . textContent ) . eq ( 'done' ) ;
171+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 0 ] . textContent ) . contain ( 'running' ) ;
172+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 0 ] . textContent ) . contain ( 'failed' ) ;
173+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 0 ] . textContent ) . contain ( 'done' ) ;
196174
197175 vi . advanceTimersByTime ( 3500 ) ;
198176 vi . useRealTimers ( ) ;
199177 // trigger table update
200178 await new Promise ( setTimeout ) ;
201179
202180 table = result . getByRole ( 'table' ) ;
203- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 0 ] . textContent ) . eq ( 'done' ) ;
204- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 0 ] . textContent ) . eq ( 'failed' ) ;
205- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 0 ] . textContent ) . eq ( 'done' ) ;
181+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 0 ] . textContent ) . contain ( 'done' ) ;
182+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 0 ] . textContent ) . contain ( 'failed' ) ;
183+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 0 ] . textContent ) . contain ( 'done' ) ;
206184 } finally {
207185 vi . useRealTimers ( ) ;
208186 }
0 commit comments