@@ -8,10 +8,33 @@ import {
8
8
testFilterPersistence ,
9
9
testFilterPresence ,
10
10
} from "../testFunctions" ;
11
- import { anvilFilters , anvilTabs , anvilTabTestOrder } from "./anvil-tabs" ;
11
+ import {
12
+ anvilFilters ,
13
+ anvilTabs ,
14
+ anvilTabTestOrder ,
15
+ BIOSAMPLE_TYPE_INDEX ,
16
+ CONSENT_GROUP_INDEX ,
17
+ DATASET_INDEX ,
18
+ DATA_MODALITY_INDEX ,
19
+ DIAGNOSIS_INDEX ,
20
+ FILE_FORMAT_INDEX ,
21
+ REPORTED_ETHNICITY_INDEX ,
22
+ } from "./anvil-tabs" ;
23
+
24
+ const FILTER_INDEX_LIST = [
25
+ DATA_MODALITY_INDEX ,
26
+ DATASET_INDEX ,
27
+ DIAGNOSIS_INDEX ,
28
+ REPORTED_ETHNICITY_INDEX ,
29
+ FILE_FORMAT_INDEX ,
30
+ CONSENT_GROUP_INDEX ,
31
+ ] ;
32
+ const FILTER_INDEX_LIST_SHORT = [
33
+ BIOSAMPLE_TYPE_INDEX ,
34
+ FILE_FORMAT_INDEX ,
35
+ DIAGNOSIS_INDEX ,
36
+ ] ;
12
37
13
- const filterIndexList = [ 3 , 4 , 5 , 10 , 6 , 2 ] ;
14
- const filterIndexListShort = [ 1 , 10 , 3 ] ;
15
38
test ( "Check that all filters exist on the Datasets tab and are clickable" , async ( {
16
39
page,
17
40
} ) => {
@@ -77,7 +100,7 @@ test("Check that filter checkboxes are persistent across pages on an arbitrary f
77
100
} ) => {
78
101
await testFilterPersistence (
79
102
page ,
80
- anvilFilters [ 3 ] ,
103
+ anvilFilters [ FILE_FORMAT_INDEX ] ,
81
104
anvilTabTestOrder . map ( ( x ) => anvilTabs [ x ] )
82
105
) ;
83
106
} ) ;
@@ -88,8 +111,8 @@ test("Check that filter menu counts match actual counts on the Datasets tab", as
88
111
const result = await testFilterCounts (
89
112
page ,
90
113
anvilTabs . datasets ,
91
- filterIndexList . map ( ( x ) => anvilFilters [ x ] ) ,
92
- 25
114
+ FILTER_INDEX_LIST . map ( ( x ) => anvilFilters [ x ] ) ,
115
+ anvilTabs . datasets . maxPages ?? 0
93
116
) ;
94
117
if ( ! result ) {
95
118
test . fail ( ) ;
@@ -102,8 +125,8 @@ test("Check that filter menu counts match actual counts on the Activities tab",
102
125
await testFilterCounts (
103
126
page ,
104
127
anvilTabs . activities ,
105
- filterIndexList . map ( ( x ) => anvilFilters [ x ] ) ,
106
- 25
128
+ FILTER_INDEX_LIST . map ( ( x ) => anvilFilters [ x ] ) ,
129
+ anvilTabs . activities . maxPages ?? 0
107
130
) ;
108
131
} ) ;
109
132
@@ -114,7 +137,7 @@ test("Check that the blue filter bubbles match the selected filter for an arbitr
114
137
await testFilterBubbles (
115
138
page ,
116
139
anvilTabs . files ,
117
- filterIndexListShort . map ( ( x ) => anvilFilters [ x ] )
140
+ FILTER_INDEX_LIST_SHORT . map ( ( x ) => anvilFilters [ x ] )
118
141
) ;
119
142
} ) ;
120
143
@@ -125,7 +148,7 @@ test("Check that the blue filter bubbles match the selected filter for an arbitr
125
148
await testFilterBubbles (
126
149
page ,
127
150
anvilTabs . biosamples ,
128
- filterIndexListShort . map ( ( x ) => anvilFilters [ x ] )
151
+ FILTER_INDEX_LIST_SHORT . map ( ( x ) => anvilFilters [ x ] )
129
152
) ;
130
153
} ) ;
131
154
@@ -136,6 +159,6 @@ test("Check that the clear all button functions on the files tab", async ({
136
159
await testClearAll (
137
160
page ,
138
161
anvilTabs . files ,
139
- filterIndexListShort . map ( ( x ) => anvilFilters [ x ] )
162
+ FILTER_INDEX_LIST_SHORT . map ( ( x ) => anvilFilters [ x ] )
140
163
) ;
141
164
} ) ;
0 commit comments