@@ -168,19 +168,19 @@ describe('utils tests', () => {
168
168
} )
169
169
describe ( 'transformTableObj' , ( ) => {
170
170
it ( 'handles empty object' , ( ) => {
171
- expect ( transformTableObj ( { } ) ) . to . eql ( { appends : { } , inserts : { } } )
171
+ expect ( transformTableObj ( { } ) ) . to . eql ( { appends : { } , inserts : { } } )
172
172
} )
173
173
it ( 'handles no appends' , ( ) => {
174
- const expected = { 1 : " hello" , 2 : " goodbye" }
175
- expect ( transformTableObj ( expected ) ) . to . eql ( { appends : { } , inserts : expected } )
174
+ const expected = { 1 : ' hello' , 2 : ' goodbye' }
175
+ expect ( transformTableObj ( expected ) ) . to . eql ( { appends : { } , inserts : expected } )
176
176
} )
177
177
it ( 'handles no inserts' , ( ) => {
178
- const expected = { "Z1" : " hello" , "Z2" : " goodbye" }
179
- expect ( transformTableObj ( expected ) ) . to . eql ( { appends : expected , inserts : { } } )
178
+ const expected = { 'Z1' : ' hello' , 'Z2' : ' goodbye' }
179
+ expect ( transformTableObj ( expected ) ) . to . eql ( { appends : expected , inserts : { } } )
180
180
} )
181
181
it ( 'handles both' , ( ) => {
182
- const expected = { appends : { "Z1" : " hello" , "Z2" : " goodbye" } , inserts : { 1 : " mee" , 2 : " moo" } }
183
- expect ( transformTableObj ( { ...expected . appends , ...expected . inserts } ) ) . to . eql ( expected )
182
+ const expected = { appends : { 'Z1' : ' hello' , 'Z2' : ' goodbye' } , inserts : { 1 : ' mee' , 2 : ' moo' } }
183
+ expect ( transformTableObj ( { ...expected . appends , ...expected . inserts } ) ) . to . eql ( expected )
184
184
} )
185
185
} )
186
186
} )
@@ -191,8 +191,8 @@ describe('Storage tests', () => {
191
191
const mockWindow = ( queryParam ) => {
192
192
const mock = {
193
193
location : {
194
- href : `https://example.com/page?${ queryParam } `
195
- }
194
+ href : `https://example.com/page?${ queryParam } ` ,
195
+ } ,
196
196
}
197
197
originalWindow = global . window
198
198
global . window = mock
@@ -224,10 +224,10 @@ describe('Storage tests', () => {
224
224
} )
225
225
226
226
const config = [
227
- { value : [ 'failed' , 'error' ] , expected : [ 'failed' , 'error' ] } ,
228
- { value : [ 'all' ] , expected : storageModule . possibleFilters }
227
+ { value : [ 'failed' , 'error' ] , expected : [ 'failed' , 'error' ] } ,
228
+ { value : [ 'all' ] , expected : storageModule . possibleFilters } ,
229
229
]
230
- config . forEach ( ( { value, expected} ) => {
230
+ config . forEach ( ( { value, expected } ) => {
231
231
it ( `handles python config: ${ value } ` , ( ) => {
232
232
mockWindow ( )
233
233
const collapsedItems = storageModule . getCollapsedCategory ( value )
@@ -236,25 +236,25 @@ describe('Storage tests', () => {
236
236
} )
237
237
238
238
const precedence = [
239
- { query : 'collapsed=xpassed,xfailed' , config : [ 'failed' , 'error' ] , expected : [ 'xpassed' , 'xfailed' ] } ,
240
- { query : 'collapsed=all' , config : [ 'failed' , 'error' ] , expected : storageModule . possibleFilters } ,
241
- { query : 'collapsed=xpassed,xfailed' , config : [ 'all' ] , expected : [ 'xpassed' , 'xfailed' ] } ,
239
+ { query : 'collapsed=xpassed,xfailed' , value : [ 'failed' , 'error' ] , expected : [ 'xpassed' , 'xfailed' ] } ,
240
+ { query : 'collapsed=all' , value : [ 'failed' , 'error' ] , expected : storageModule . possibleFilters } ,
241
+ { query : 'collapsed=xpassed,xfailed' , value : [ 'all' ] , expected : [ 'xpassed' , 'xfailed' ] } ,
242
242
]
243
- precedence . forEach ( ( { query, config , expected} , index ) => {
243
+ precedence . forEach ( ( { query, value , expected } , index ) => {
244
244
it ( `handles python config precedence ${ index + 1 } ` , ( ) => {
245
245
mockWindow ( query )
246
- const collapsedItems = storageModule . getCollapsedCategory ( config )
246
+ const collapsedItems = storageModule . getCollapsedCategory ( value )
247
247
expect ( collapsedItems ) . to . eql ( expected )
248
248
} )
249
249
} )
250
250
251
251
const falsy = [
252
- { param : 'collapsed' } ,
253
- { param : 'collapsed=' } ,
254
- { param : 'collapsed=""' } ,
255
- { param : 'collapsed=\'\'' }
252
+ { param : 'collapsed' } ,
253
+ { param : 'collapsed=' } ,
254
+ { param : 'collapsed=""' } ,
255
+ { param : 'collapsed=\'\'' } ,
256
256
]
257
- falsy . forEach ( ( { param} ) => {
257
+ falsy . forEach ( ( { param } ) => {
258
258
it ( `collapses none with ${ param } ` , ( ) => {
259
259
mockWindow ( param )
260
260
const collapsedItems = storageModule . getCollapsedCategory ( )
0 commit comments