11import { browser } from '../../../../helper'
22
3+ const getCookieQueryArgs = ( ) =>
4+ browser . cookies . getAll . getCalls ( ) . map ( call => call . args [ 0 ] )
5+
36describe ( 'Dict/Cambridge/network' , ( ) => {
47 let originalWebRequest : typeof browser . webRequest
58
@@ -116,7 +119,7 @@ describe('Dict/Cambridge/network', () => {
116119
117120 await ensureNetworkCompatibility ( )
118121
119- expect ( browser . cookies . getAll . thirdCall . args [ 0 ] ) . toEqual ( {
122+ expect ( getCookieQueryArgs ( ) ) . toContainEqual ( {
120123 url : 'https://dictionary.cambridge.org' ,
121124 partitionKey : {
122125 topLevelSite : 'https://cambridge.org'
@@ -142,7 +145,7 @@ describe('Dict/Cambridge/network', () => {
142145 } )
143146 } )
144147
145- it ( 'should preserve same-name cookies in MV2' , async ( ) => {
148+ it ( 'should append partitioned cookies in MV2' , async ( ) => {
146149 browser . cookies . getAll . callsFake ( options =>
147150 Promise . resolve (
148151 options . partitionKey
@@ -318,7 +321,7 @@ describe('Dict/Cambridge/network', () => {
318321 } ,
319322 {
320323 header : 'cookie' ,
321- operation : 'set ' ,
324+ operation : 'append ' ,
322325 value : 'cf_clearance=next-clearance-token'
323326 }
324327 ]
@@ -362,7 +365,7 @@ describe('Dict/Cambridge/network', () => {
362365
363366 await ensureNetworkCompatibility ( )
364367
365- expect ( browser . cookies . getAll . thirdCall . args [ 0 ] ) . toEqual ( {
368+ expect ( getCookieQueryArgs ( ) ) . toContainEqual ( {
366369 url : 'https://dictionary.cambridge.org' ,
367370 partitionKey : {
368371 topLevelSite : 'https://cambridge.org'
@@ -382,7 +385,7 @@ describe('Dict/Cambridge/network', () => {
382385 } ,
383386 {
384387 header : 'cookie' ,
385- operation : 'set ' ,
388+ operation : 'append ' ,
386389 value :
387390 'cf_clearance=partitioned-clearance-token; cf_chl_rc_ni=1'
388391 }
0 commit comments