@@ -46,13 +46,14 @@ export default function (options) {
4646 let cookieService = store . get ( '_cookies' ) ;
4747 await store . persist ( { key : 'value' } ) ;
4848
49- assert . ok (
49+ assert . true (
5050 cookieService . write . calledWith ( 'test:session' , JSON . stringify ( { key : 'value' } ) , {
5151 domain : null ,
5252 expires : null ,
5353 path : '/' ,
5454 sameSite : null ,
5555 secure : false ,
56+ partitioned : null ,
5657 } )
5758 ) ;
5859 } ) ;
@@ -65,13 +66,14 @@ export default function (options) {
6566 } ) ;
6667 await store . persist ( { key : 'value' } ) ;
6768
68- assert . ok (
69+ assert . true (
6970 cookieService . write . calledWith ( 'session-cookie-domain' , JSON . stringify ( { key : 'value' } ) , {
7071 domain : 'example.com' ,
7172 expires : null ,
7273 path : '/' ,
7374 sameSite : null ,
7475 secure : false ,
76+ partitioned : null ,
7577 } )
7678 ) ;
7779 } ) ;
@@ -85,13 +87,14 @@ export default function (options) {
8587 let cookieService = store . get ( '_cookies' ) ;
8688 await store . persist ( { key : 'value' } ) ;
8789
88- assert . ok (
90+ assert . true (
8991 cookieService . write . calledWith ( 'session-cookie-domain' , JSON . stringify ( { key : 'value' } ) , {
9092 domain : 'example.com' ,
9193 expires : null ,
9294 path : '/hello-world' ,
9395 sameSite : null ,
9496 secure : false ,
97+ partitioned : null ,
9598 } )
9699 ) ;
97100 } ) ;
@@ -104,17 +107,42 @@ export default function (options) {
104107 } ) ;
105108 let cookieService = store . get ( '_cookies' ) ;
106109 await store . persist ( { key : 'value' } ) ;
107- assert . ok (
110+ assert . true (
108111 cookieService . write . calledWith ( 'session-cookie-domain' , JSON . stringify ( { key : 'value' } ) , {
109112 domain : 'example.com' ,
110113 expires : null ,
111114 path : '/' ,
112115 sameSite : 'Strict' ,
113116 secure : false ,
117+ partitioned : null ,
114118 } )
115119 ) ;
116120 } ) ;
117121
122+ test ( 'respects the configured partitioned' , async function ( assert ) {
123+ run ( ( ) => {
124+ store . set ( 'cookieName' , 'session-cookie-partitioned' ) ;
125+ store . set ( 'cookieDomain' , 'example.com' ) ;
126+ store . set ( 'partitioned' , true ) ;
127+ } ) ;
128+ let cookieService = store . get ( '_cookies' ) ;
129+ await store . persist ( { key : 'value' } ) ;
130+ assert . true (
131+ cookieService . write . calledWith (
132+ 'session-cookie-partitioned' ,
133+ JSON . stringify ( { key : 'value' } ) ,
134+ {
135+ domain : 'example.com' ,
136+ expires : null ,
137+ path : '/' ,
138+ sameSite : null ,
139+ secure : false ,
140+ partitioned : true ,
141+ }
142+ )
143+ ) ;
144+ } ) ;
145+
118146 test ( 'sends a warning when `cookieExpirationTime` is less than 90 seconds' , async function ( assert ) {
119147 assert . expect ( 2 ) ;
120148 run ( ( ) => {
@@ -155,7 +183,7 @@ export default function (options) {
155183 } ) ;
156184
157185 test ( 'stores the expiration time in a cookie named "test-session-expiration_time"' , function ( assert ) {
158- assert . ok (
186+ assert . true (
159187 cookieService . write . calledWith (
160188 'test-session-expiration_time' ,
161189 60 ,
@@ -212,7 +240,7 @@ export default function (options) {
212240 await new Promise ( resolve => {
213241 next ( ( ) => {
214242 next ( ( ) => {
215- assert . ok ( triggered ) ;
243+ assert . true ( triggered ) ;
216244 resolve ( ) ;
217245 } ) ;
218246 } ) ;
@@ -264,11 +292,11 @@ export default function (options) {
264292 } ) ;
265293 await store . persist ( { key : 'value' } ) ;
266294
267- assert . ok ( cookieService . clear . calledWith ( 'session-foo' ) ) ;
295+ assert . true ( cookieService . clear . calledWith ( 'session-foo' ) ) ;
268296
269- assert . ok ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
297+ assert . true ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
270298
271- assert . ok (
299+ assert . true (
272300 cookieService . write . calledWith (
273301 'session-bar' ,
274302 JSON . stringify ( { key : 'value' } ) ,
@@ -283,7 +311,7 @@ export default function (options) {
283311 )
284312 ) ;
285313
286- assert . ok (
314+ assert . true (
287315 cookieService . write . calledWith (
288316 'session-bar-expiration_time' ,
289317 1000 ,
@@ -307,11 +335,11 @@ export default function (options) {
307335 } ) ;
308336 await store . persist ( { key : 'value' } ) ;
309337
310- assert . ok ( cookieService . clear . calledWith ( defaultName ) ) ;
338+ assert . true ( cookieService . clear . calledWith ( defaultName ) ) ;
311339
312- assert . ok ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
340+ assert . true ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
313341
314- assert . ok (
342+ assert . true (
315343 cookieService . write . calledWith (
316344 'session-bar' ,
317345 JSON . stringify ( { key : 'value' } ) ,
@@ -336,11 +364,11 @@ export default function (options) {
336364 } ) ;
337365 await store . persist ( { key : 'value' } ) ;
338366
339- assert . ok ( cookieService . clear . calledWith ( defaultName ) ) ;
367+ assert . true ( cookieService . clear . calledWith ( defaultName ) ) ;
340368
341- assert . ok ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
369+ assert . true ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
342370
343- assert . ok (
371+ assert . true (
344372 cookieService . write . calledWith (
345373 'session-bar' ,
346374 JSON . stringify ( { key : 'value' } ) ,
@@ -364,7 +392,7 @@ export default function (options) {
364392
365393 await new Promise ( resolve => {
366394 next ( ( ) => {
367- assert . ok ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
395+ assert . true ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
368396 resolve ( ) ;
369397 } ) ;
370398 } ) ;
@@ -379,7 +407,7 @@ export default function (options) {
379407
380408 await new Promise ( resolve => {
381409 next ( ( ) => {
382- assert . ok ( cookieSpy . calledOnce ) ;
410+ assert . true ( cookieSpy . calledOnce ) ;
383411 resolve ( ) ;
384412 } ) ;
385413 } ) ;
0 commit comments