@@ -62,11 +62,11 @@ describe('the task table', () => {
6262 } )
6363
6464 it ( "shows a finished task's status as an icon left of its id" , ( ) => {
65- const task = table ( finished , 'finished' ) . findAll ( 'td' ) [ 0 ] . get ( 'div' )
65+ const task = table ( finished , 'finished' ) . get ( 'td' ) . get ( 'div' )
6666 const [ icon , id ] = task . element . children
67- expect ( icon . getAttribute ( 'role' ) ) . toBe ( 'img' )
68- expect ( icon . getAttribute ( 'aria-label' ) ) . toBe ( 'completed' )
69- expect ( id . tagName . toLowerCase ( ) ) . toBe ( 'task-logs-button-stub' )
67+ expect ( icon ! . getAttribute ( 'role' ) ) . toBe ( 'img' )
68+ expect ( icon ! . getAttribute ( 'aria-label' ) ) . toBe ( 'completed' )
69+ expect ( id ! . tagName . toLowerCase ( ) ) . toBe ( 'task-logs-button-stub' )
7070 expect ( task . text ( ) ) . toBe ( '' )
7171 } )
7272
@@ -90,17 +90,15 @@ describe('the task table', () => {
9090 ...finished ,
9191 finished_at : new Date ( Date . parse ( `${ at ( 1 ) } Z` ) + seconds * 1000 ) . toISOString ( ) ,
9292 }
93- expect ( taskTimes ( ran , 'finished' ) . at ( - 1 ) ) . toEqual ( {
94- label : 'Ran' ,
95- value : shown ,
96- duration : true ,
97- } )
93+ expect ( taskTimes ( ran , 'finished' ) . slice ( - 1 ) ) . toEqual ( [
94+ { label : 'Ran' , value : shown , duration : true } ,
95+ ] )
9896 } )
9997
10098 it ( 'gives a running task how long it waited, and no run time' , ( ) => {
10199 const times = taskTimes ( { ...queued , started_at : at ( 3 ) } , 'running' )
102100 expect ( times . map ( time => time . label ) ) . toEqual ( [ 'Queued' , 'Started' , 'Waited' ] )
103- expect ( times . at ( - 1 ) ! . value ) . toBe ( '3:00 mins' )
101+ expect ( times [ 2 ] ! . value ) . toBe ( '3:00 mins' )
104102 } )
105103
106104 it ( "shows a running task's two dates in its row, without its wait" , ( ) => {
@@ -119,7 +117,7 @@ describe('the task table', () => {
119117 const wrapper = table ( queued , 'queued' )
120118 expect ( pairs ( queued , 'queued' , 'times' ) ) . toEqual ( [ [ 'Queued' , formatDate ( at ( 0 ) ) ] ] )
121119 expect ( wrapper . find ( '[data-durations]' ) . exists ( ) ) . toBe ( false )
122- expect ( wrapper . findAll ( 'td' ) [ 0 ] . text ( ) ) . toBe ( '' )
120+ expect ( wrapper . get ( 'td' ) . text ( ) ) . toBe ( '' )
123121 } )
124122
125123 it ( 'shows each label with its value beside it' , ( ) => {
0 commit comments