9
9
testFilterTags ,
10
10
} from "../testFunctions" ;
11
11
import {
12
- anvilFilterNames ,
13
- anvilTabs ,
14
- anvilTabTestOrder ,
12
+ ANVIL_FILTER_NAMES ,
13
+ ANVIL_TABS ,
14
+ ANVIL_TAB_TEST_ORDER ,
15
15
BIOSAMPLE_TYPE_INDEX ,
16
16
CONSENT_GROUP_INDEX ,
17
17
DATASET_INDEX ,
@@ -38,49 +38,51 @@ const FILTER_INDEX_LIST_SHORT = [
38
38
test ( "Check that all filters exist on the Datasets tab and are clickable" , async ( {
39
39
page,
40
40
} ) => {
41
- await testFilterPresence ( page , anvilTabs . datasets , anvilFilterNames ) ;
41
+ await testFilterPresence ( page , ANVIL_TABS . DATASETS , ANVIL_FILTER_NAMES ) ;
42
42
} ) ;
43
43
44
44
test ( "Check that all filters exist on the Donors tab and are clickable" , async ( {
45
45
page,
46
46
} ) => {
47
- await testFilterPresence ( page , anvilTabs . donors , anvilFilterNames ) ;
47
+ await testFilterPresence ( page , ANVIL_TABS . DONORS , ANVIL_FILTER_NAMES ) ;
48
48
} ) ;
49
49
50
50
test ( "Check that all filters exist on the BioSamples tab and are clickable" , async ( {
51
51
page,
52
52
} ) => {
53
- await testFilterPresence ( page , anvilTabs . biosamples , anvilFilterNames ) ;
53
+ await testFilterPresence ( page , ANVIL_TABS . BIOSAMPLES , ANVIL_FILTER_NAMES ) ;
54
54
} ) ;
55
55
56
56
test ( "Check that all filters exist on the Activities tab and are clickable" , async ( {
57
57
page,
58
58
} ) => {
59
- await testFilterPresence ( page , anvilTabs . activities , anvilFilterNames ) ;
59
+ await testFilterPresence ( page , ANVIL_TABS . ACTIVITIES , ANVIL_FILTER_NAMES ) ;
60
60
} ) ;
61
61
62
62
test ( "Check that all filters exist on the Files tab and are clickable" , async ( {
63
63
page,
64
64
} ) => {
65
- await testFilterPresence ( page , anvilTabs . files , anvilFilterNames ) ;
65
+ await testFilterPresence ( page , ANVIL_TABS . FILES , ANVIL_FILTER_NAMES ) ;
66
66
} ) ;
67
67
68
68
test ( "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 ( {
69
69
page,
70
70
} ) => {
71
71
test . setTimeout ( 120000 ) ;
72
72
// Goto the datasets tab
73
- await page . goto ( anvilTabs . datasets . url ) ;
73
+ await page . goto ( ANVIL_TABS . DATASETS . url ) ;
74
74
await expect (
75
- page . getByRole ( "tab" ) . getByText ( anvilTabs . datasets . tabName )
75
+ page . getByRole ( "tab" ) . getByText ( ANVIL_TABS . DATASETS . tabName )
76
76
) . toBeVisible ( ) ;
77
77
78
78
// Select a filter
79
79
await page
80
80
. getByRole ( "button" )
81
81
. getByText (
82
82
filterRegex (
83
- anvilFilterNames [ Math . floor ( Math . random ( ) * anvilFilterNames . length ) ]
83
+ ANVIL_FILTER_NAMES [
84
+ Math . floor ( Math . random ( ) * ANVIL_FILTER_NAMES . length )
85
+ ]
84
86
)
85
87
)
86
88
. click ( ) ;
@@ -104,8 +106,8 @@ test("Check that filter checkboxes are persistent across pages on an arbitrary f
104
106
test . setTimeout ( 120000 ) ;
105
107
const result = await testFilterPersistence (
106
108
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 ] )
109
111
) ;
110
112
if ( ! result ) {
111
113
test . fail ( ) ;
@@ -118,9 +120,9 @@ test("Check that filter menu counts match actual counts on the Datasets tab", as
118
120
test . setTimeout ( 120000 ) ;
119
121
const result = await testFilterCounts (
120
122
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
124
126
) ;
125
127
if ( ! result ) {
126
128
test . fail ( ) ;
@@ -133,9 +135,9 @@ test("Check that filter menu counts match actual counts on the Activities tab",
133
135
test . setTimeout ( 120000 ) ;
134
136
await testFilterCounts (
135
137
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
139
141
) ;
140
142
} ) ;
141
143
@@ -145,8 +147,8 @@ test("Check that the filter tags match the selected filter for an arbitrary filt
145
147
test . setTimeout ( 120000 ) ;
146
148
await testFilterTags (
147
149
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 ] )
150
152
) ;
151
153
} ) ;
152
154
@@ -156,8 +158,8 @@ test("Check that the filter tags match the selected filter for an arbitrary filt
156
158
test . setTimeout ( 120000 ) ;
157
159
await testFilterTags (
158
160
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 ] )
161
163
) ;
162
164
} ) ;
163
165
@@ -167,7 +169,7 @@ test("Check that the clear all button functions on the files tab", async ({
167
169
test . setTimeout ( 120000 ) ;
168
170
await testClearAll (
169
171
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 ] )
172
174
) ;
173
175
} ) ;
0 commit comments