@@ -206,9 +206,10 @@ describe('cosmeticFilterTestSuite', () => {
206
206
'brave.com' : [ filter ]
207
207
}
208
208
} )
209
- cosmeticFilterAPI . applySiteFilters ( 'brave.com' )
210
- expect ( insertCSSStub . getCall ( 0 ) . args [ 0 ] ) . toEqual ( {
211
- code : `${ filter } {display: none !important;}` ,
209
+ cosmeticFilterAPI . applySiteFilters ( 1 , 'brave.com' )
210
+ expect ( insertCSSStub . getCall ( 0 ) . args [ 0 ] ) . toEqual ( 1 )
211
+ expect ( insertCSSStub . getCall ( 0 ) . args [ 1 ] ) . toEqual ( {
212
+ code : `${ filter } {display: none !important;}` ,
212
213
cssOrigin : 'user' ,
213
214
runAt : 'document_start'
214
215
} )
@@ -219,13 +220,15 @@ describe('cosmeticFilterTestSuite', () => {
219
220
'brave.com' : [ filter , filter2 ]
220
221
}
221
222
} )
222
- cosmeticFilterAPI . applySiteFilters ( 'brave.com' )
223
- expect ( insertCSSStub . getCall ( 0 ) . args [ 0 ] ) . toEqual ( {
223
+ cosmeticFilterAPI . applySiteFilters ( 1 , 'brave.com' )
224
+ expect ( insertCSSStub . getCall ( 0 ) . args [ 0 ] ) . toEqual ( 1 )
225
+ expect ( insertCSSStub . getCall ( 0 ) . args [ 1 ] ) . toEqual ( {
224
226
code : `${ filter } {display: none !important;}` ,
225
227
cssOrigin : 'user' ,
226
228
runAt : 'document_start'
227
229
} )
228
- expect ( insertCSSStub . getCall ( 1 ) . args [ 0 ] ) . toEqual ( {
230
+ expect ( insertCSSStub . getCall ( 1 ) . args [ 0 ] ) . toEqual ( 1 )
231
+ expect ( insertCSSStub . getCall ( 1 ) . args [ 1 ] ) . toEqual ( {
229
232
code : `${ filter2 } {display: none !important;}` ,
230
233
cssOrigin : 'user' ,
231
234
runAt : 'document_start'
@@ -237,7 +240,7 @@ describe('cosmeticFilterTestSuite', () => {
237
240
getStorageStub . yields ( {
238
241
cosmeticFilterList : { }
239
242
} )
240
- cosmeticFilterAPI . applySiteFilters ( 'brave.com' )
243
+ cosmeticFilterAPI . applySiteFilters ( 1 , 'brave.com' )
241
244
expect ( insertCSSStub . called ) . toBe ( false )
242
245
} )
243
246
it ( 'doesn\'t apply filters if storage is explicitly undefined' , ( ) => {
@@ -246,7 +249,7 @@ describe('cosmeticFilterTestSuite', () => {
246
249
'brave.com' : undefined
247
250
}
248
251
} )
249
- cosmeticFilterAPI . applySiteFilters ( 'brave.com' )
252
+ cosmeticFilterAPI . applySiteFilters ( 1 , 'brave.com' )
250
253
expect ( insertCSSStub . called ) . toBe ( false )
251
254
} )
252
255
} )
0 commit comments