99 testFilterTags ,
1010} from "../testFunctions" ;
1111import {
12- anvilFilterNames ,
13- anvilTabs ,
14- anvilTabTestOrder ,
12+ ANVIL_FILTER_NAMES ,
13+ ANVIL_TABS ,
14+ ANVIL_TAB_TEST_ORDER ,
1515 BIOSAMPLE_TYPE_INDEX ,
1616 CONSENT_GROUP_INDEX ,
1717 DATASET_INDEX ,
@@ -38,49 +38,51 @@ const FILTER_INDEX_LIST_SHORT = [
3838test ( "Check that all filters exist on the Datasets tab and are clickable" , async ( {
3939 page,
4040} ) => {
41- await testFilterPresence ( page , anvilTabs . datasets , anvilFilterNames ) ;
41+ await testFilterPresence ( page , ANVIL_TABS . DATASETS , ANVIL_FILTER_NAMES ) ;
4242} ) ;
4343
4444test ( "Check that all filters exist on the Donors tab and are clickable" , async ( {
4545 page,
4646} ) => {
47- await testFilterPresence ( page , anvilTabs . donors , anvilFilterNames ) ;
47+ await testFilterPresence ( page , ANVIL_TABS . DONORS , ANVIL_FILTER_NAMES ) ;
4848} ) ;
4949
5050test ( "Check that all filters exist on the BioSamples tab and are clickable" , async ( {
5151 page,
5252} ) => {
53- await testFilterPresence ( page , anvilTabs . biosamples , anvilFilterNames ) ;
53+ await testFilterPresence ( page , ANVIL_TABS . BIOSAMPLES , ANVIL_FILTER_NAMES ) ;
5454} ) ;
5555
5656test ( "Check that all filters exist on the Activities tab and are clickable" , async ( {
5757 page,
5858} ) => {
59- await testFilterPresence ( page , anvilTabs . activities , anvilFilterNames ) ;
59+ await testFilterPresence ( page , ANVIL_TABS . ACTIVITIES , ANVIL_FILTER_NAMES ) ;
6060} ) ;
6161
6262test ( "Check that all filters exist on the Files tab and are clickable" , async ( {
6363 page,
6464} ) => {
65- await testFilterPresence ( page , anvilTabs . files , anvilFilterNames ) ;
65+ await testFilterPresence ( page , ANVIL_TABS . FILES , ANVIL_FILTER_NAMES ) ;
6666} ) ;
6767
6868test ( "Check that the first filter on the Datasets tab creates at least one checkbox, and that checking up to the first five does not cause an error and does not cause there to be no entries in the table" , async ( {
6969 page,
7070} ) => {
7171 test . setTimeout ( 120000 ) ;
7272 // Goto the datasets tab
73- await page . goto ( anvilTabs . datasets . url ) ;
73+ await page . goto ( ANVIL_TABS . DATASETS . url ) ;
7474 await expect (
75- page . getByRole ( "tab" ) . getByText ( anvilTabs . datasets . tabName )
75+ page . getByRole ( "tab" ) . getByText ( ANVIL_TABS . DATASETS . tabName )
7676 ) . toBeVisible ( ) ;
7777
7878 // Select a filter
7979 await page
8080 . getByRole ( "button" )
8181 . getByText (
8282 filterRegex (
83- anvilFilterNames [ Math . floor ( Math . random ( ) * anvilFilterNames . length ) ]
83+ ANVIL_FILTER_NAMES [
84+ Math . floor ( Math . random ( ) * ANVIL_FILTER_NAMES . length )
85+ ]
8486 )
8587 )
8688 . click ( ) ;
@@ -104,8 +106,8 @@ test("Check that filter checkboxes are persistent across pages on an arbitrary f
104106 test . setTimeout ( 120000 ) ;
105107 const result = await testFilterPersistence (
106108 page ,
107- anvilFilterNames [ FILE_FORMAT_INDEX ] ,
108- anvilTabTestOrder . map ( ( x ) => anvilTabs [ x ] )
109+ ANVIL_FILTER_NAMES [ FILE_FORMAT_INDEX ] ,
110+ ANVIL_TAB_TEST_ORDER . map ( ( x ) => ANVIL_TABS [ x ] )
109111 ) ;
110112 if ( ! result ) {
111113 test . fail ( ) ;
@@ -118,9 +120,9 @@ test("Check that filter menu counts match actual counts on the Datasets tab", as
118120 test . setTimeout ( 120000 ) ;
119121 const result = await testFilterCounts (
120122 page ,
121- anvilTabs . datasets ,
122- FILTER_INDEX_LIST . map ( ( x ) => anvilFilterNames [ x ] ) ,
123- anvilTabs . datasets . maxPages ?? 0
123+ ANVIL_TABS . DATASETS ,
124+ FILTER_INDEX_LIST . map ( ( x ) => ANVIL_FILTER_NAMES [ x ] ) ,
125+ ANVIL_TABS . DATASETS . maxPages ?? 0
124126 ) ;
125127 if ( ! result ) {
126128 test . fail ( ) ;
@@ -133,9 +135,9 @@ test("Check that filter menu counts match actual counts on the Activities tab",
133135 test . setTimeout ( 120000 ) ;
134136 await testFilterCounts (
135137 page ,
136- anvilTabs . activities ,
137- FILTER_INDEX_LIST . map ( ( x ) => anvilFilterNames [ x ] ) ,
138- anvilTabs . activities . maxPages ?? 0
138+ ANVIL_TABS . ACTIVITIES ,
139+ FILTER_INDEX_LIST . map ( ( x ) => ANVIL_FILTER_NAMES [ x ] ) ,
140+ ANVIL_TABS . ACTIVITIES . maxPages ?? 0
139141 ) ;
140142} ) ;
141143
@@ -145,8 +147,8 @@ test("Check that the filter tags match the selected filter for an arbitrary filt
145147 test . setTimeout ( 120000 ) ;
146148 await testFilterTags (
147149 page ,
148- anvilTabs . files ,
149- FILTER_INDEX_LIST_SHORT . map ( ( x ) => anvilFilterNames [ x ] )
150+ ANVIL_TABS . FILES ,
151+ FILTER_INDEX_LIST_SHORT . map ( ( x ) => ANVIL_FILTER_NAMES [ x ] )
150152 ) ;
151153} ) ;
152154
@@ -156,8 +158,8 @@ test("Check that the filter tags match the selected filter for an arbitrary filt
156158 test . setTimeout ( 120000 ) ;
157159 await testFilterTags (
158160 page ,
159- anvilTabs . biosamples ,
160- FILTER_INDEX_LIST_SHORT . map ( ( x ) => anvilFilterNames [ x ] )
161+ ANVIL_TABS . BIOSAMPLES ,
162+ FILTER_INDEX_LIST_SHORT . map ( ( x ) => ANVIL_FILTER_NAMES [ x ] )
161163 ) ;
162164} ) ;
163165
@@ -167,7 +169,7 @@ test("Check that the clear all button functions on the files tab", async ({
167169 test . setTimeout ( 120000 ) ;
168170 await testClearAll (
169171 page ,
170- anvilTabs . files ,
171- FILTER_INDEX_LIST_SHORT . map ( ( x ) => anvilFilterNames [ x ] )
172+ ANVIL_TABS . FILES ,
173+ FILTER_INDEX_LIST_SHORT . map ( ( x ) => ANVIL_FILTER_NAMES [ x ] )
172174 ) ;
173175} ) ;
0 commit comments