@@ -39,76 +39,76 @@ describe('JobsList', () => {
3939
4040 const filters = result . getAllByRole ( 'combobox' ) ;
4141
42- const projectFilter = filters [ 0 ] ;
42+ const statusFilter = filters [ 0 ] ;
43+ verifyOptions ( statusFilter , [ '' , 'running' , 'done' , 'failed' , 'submitted' ] ) ;
44+ const projectFilter = filters [ 1 ] ;
4345 verifyOptions ( projectFilter , [ '' , '1' , '2' ] ) ;
44- const workflowFilter = filters [ 1 ] ;
46+ const workflowFilter = filters [ 2 ] ;
4547 verifyOptions ( workflowFilter , [ '' , '1' , '2' ] ) ;
46- const inputDatasetFilter = filters [ 2 ] ;
48+ const inputDatasetFilter = filters [ 3 ] ;
4749 verifyOptions ( inputDatasetFilter , [ '' , '1' , '3' , '5' ] ) ;
48- const outputDatasetFilter = filters [ 3 ] ;
50+ const outputDatasetFilter = filters [ 4 ] ;
4951 verifyOptions ( outputDatasetFilter , [ '' , '2' , '4' , '6' ] ) ;
50- const statusFilter = filters [ 4 ] ;
51- verifyOptions ( statusFilter , [ '' , 'running' , 'done' , 'failed' , 'submitted' ] ) ;
5252
5353 // Filter by project
5454 await fireEvent . change ( projectFilter , { target : { value : '1' } } ) ;
5555 table = result . getByRole ( 'table' ) ;
5656 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 1 ) ;
57- expect ( table . querySelectorAll ( 'tbody tr td' ) [ 5 ] . textContent ) . eq ( 'input1' ) ;
57+ expect ( table . querySelectorAll ( 'tbody tr td' ) [ 6 ] . textContent ) . eq ( 'input1' ) ;
5858 await clearFilters ( result ) ;
5959
6060 // Filter by workflow
6161 await fireEvent . change ( workflowFilter , { target : { value : '2' } } ) ;
6262 table = result . getByRole ( 'table' ) ;
6363 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 2 ) ;
64- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 5 ] . textContent ) . eq ( 'input3' ) ;
65- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 5 ] . textContent ) . eq ( 'input2' ) ;
64+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 6 ] . textContent ) . eq ( 'input3' ) ;
65+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 6 ] . textContent ) . eq ( 'input2' ) ;
6666 await clearFilters ( result ) ;
6767
6868 // Filter by input dataset
6969 await fireEvent . change ( inputDatasetFilter , { target : { value : '3' } } ) ;
7070 table = result . getByRole ( 'table' ) ;
7171 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 1 ) ;
72- expect ( table . querySelectorAll ( 'tbody tr td' ) [ 5 ] . textContent ) . eq ( 'input2' ) ;
72+ expect ( table . querySelectorAll ( 'tbody tr td' ) [ 6 ] . textContent ) . eq ( 'input2' ) ;
7373 await clearFilters ( result ) ;
7474
7575 // Filter by output dataset
7676 await fireEvent . change ( outputDatasetFilter , { target : { value : '4' } } ) ;
7777 table = result . getByRole ( 'table' ) ;
7878 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 1 ) ;
79- expect ( table . querySelectorAll ( 'tbody tr td' ) [ 6 ] . textContent ) . eq ( 'output2' ) ;
79+ expect ( table . querySelectorAll ( 'tbody tr td' ) [ 7 ] . textContent ) . eq ( 'output2' ) ;
8080 await clearFilters ( result ) ;
8181
8282 // Filter by job status
8383 await fireEvent . change ( statusFilter , { target : { value : 'running' } } ) ;
8484 table = result . getByRole ( 'table' ) ;
8585 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 1 ) ;
86- expect ( table . querySelectorAll ( 'tbody tr td' ) [ 5 ] . textContent ) . eq ( 'input3' ) ;
86+ expect ( table . querySelectorAll ( 'tbody tr td' ) [ 6 ] . textContent ) . eq ( 'input3' ) ;
8787 await clearFilters ( result ) ;
8888
8989 // Verify default sorting
9090 table = result . getByRole ( 'table' ) ;
91- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 1 ] . textContent ) . eq (
91+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 2 ] . textContent ) . eq (
9292 '10/30/2023, 9:30:38 AM'
9393 ) ;
94- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 1 ] . textContent ) . eq (
94+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 2 ] . textContent ) . eq (
9595 '10/30/2023, 9:15:38 AM'
9696 ) ;
97- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 1 ] . textContent ) . eq (
97+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 2 ] . textContent ) . eq (
9898 '10/30/2023, 9:00:38 AM'
9999 ) ;
100100
101101 // Sort by start date
102- const startDateSorter = table . querySelector ( 'thead th:nth-child(2 )' ) ;
102+ const startDateSorter = table . querySelector ( 'thead th:nth-child(3 )' ) ;
103103 await fireEvent . click ( startDateSorter ) ;
104104 table = result . getByRole ( 'table' ) ;
105- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 1 ] . textContent ) . eq (
105+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 2 ] . textContent ) . eq (
106106 '10/30/2023, 9:00:38 AM'
107107 ) ;
108- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 1 ] . textContent ) . eq (
108+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 2 ] . textContent ) . eq (
109109 '10/30/2023, 9:15:38 AM'
110110 ) ;
111- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 1 ] . textContent ) . eq (
111+ expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 2 ] . textContent ) . eq (
112112 '10/30/2023, 9:30:38 AM'
113113 ) ;
114114 } ) ;
@@ -127,17 +127,17 @@ describe('JobsList', () => {
127127 } ) ;
128128 let table = result . getByRole ( 'table' ) ;
129129 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 3 ) ;
130- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 7 ] . textContent ) . eq ( 'running' ) ;
131- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 7 ] . textContent ) . eq ( 'failed' ) ;
132- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 7 ] . textContent ) . eq ( 'done' ) ;
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' ) ;
133133
134134 const refreshButton = result . getByRole ( 'button' , { name : 'Refresh' } ) ;
135135 await fireEvent . click ( refreshButton ) ;
136136
137137 table = result . getByRole ( 'table' ) ;
138- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 7 ] . textContent ) . eq ( 'done' ) ;
139- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 7 ] . textContent ) . eq ( 'failed' ) ;
140- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 7 ] . textContent ) . eq ( 'done' ) ;
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' ) ;
141141 } ) ;
142142
143143 it ( 'cancel job' , async ( ) => {
@@ -190,19 +190,19 @@ describe('JobsList', () => {
190190 } ) ;
191191 let table = result . getByRole ( 'table' ) ;
192192 expect ( table . querySelectorAll ( 'tbody tr' ) . length ) . eq ( 3 ) ;
193- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 7 ] . textContent ) . eq ( 'running' ) ;
194- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 7 ] . textContent ) . eq ( 'failed' ) ;
195- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 7 ] . textContent ) . eq ( 'done' ) ;
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' ) ;
196196
197197 vi . advanceTimersByTime ( 3500 ) ;
198198 vi . useRealTimers ( ) ;
199199 // trigger table update
200200 await new Promise ( setTimeout ) ;
201201
202202 table = result . getByRole ( 'table' ) ;
203- expect ( table . querySelectorAll ( 'tbody tr:nth-child(1) td' ) [ 7 ] . textContent ) . eq ( 'done' ) ;
204- expect ( table . querySelectorAll ( 'tbody tr:nth-child(2) td' ) [ 7 ] . textContent ) . eq ( 'failed' ) ;
205- expect ( table . querySelectorAll ( 'tbody tr:nth-child(3) td' ) [ 7 ] . textContent ) . eq ( 'done' ) ;
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' ) ;
206206 } finally {
207207 vi . useRealTimers ( ) ;
208208 }
0 commit comments