@@ -46,13 +46,14 @@ export default function (options) {
46
46
let cookieService = store . get ( '_cookies' ) ;
47
47
await store . persist ( { key : 'value' } ) ;
48
48
49
- assert . ok (
49
+ assert . true (
50
50
cookieService . write . calledWith ( 'test:session' , JSON . stringify ( { key : 'value' } ) , {
51
51
domain : null ,
52
52
expires : null ,
53
53
path : '/' ,
54
54
sameSite : null ,
55
55
secure : false ,
56
+ partitioned : null ,
56
57
} )
57
58
) ;
58
59
} ) ;
@@ -65,13 +66,14 @@ export default function (options) {
65
66
} ) ;
66
67
await store . persist ( { key : 'value' } ) ;
67
68
68
- assert . ok (
69
+ assert . true (
69
70
cookieService . write . calledWith ( 'session-cookie-domain' , JSON . stringify ( { key : 'value' } ) , {
70
71
domain : 'example.com' ,
71
72
expires : null ,
72
73
path : '/' ,
73
74
sameSite : null ,
74
75
secure : false ,
76
+ partitioned : null ,
75
77
} )
76
78
) ;
77
79
} ) ;
@@ -85,13 +87,14 @@ export default function (options) {
85
87
let cookieService = store . get ( '_cookies' ) ;
86
88
await store . persist ( { key : 'value' } ) ;
87
89
88
- assert . ok (
90
+ assert . true (
89
91
cookieService . write . calledWith ( 'session-cookie-domain' , JSON . stringify ( { key : 'value' } ) , {
90
92
domain : 'example.com' ,
91
93
expires : null ,
92
94
path : '/hello-world' ,
93
95
sameSite : null ,
94
96
secure : false ,
97
+ partitioned : null ,
95
98
} )
96
99
) ;
97
100
} ) ;
@@ -104,17 +107,42 @@ export default function (options) {
104
107
} ) ;
105
108
let cookieService = store . get ( '_cookies' ) ;
106
109
await store . persist ( { key : 'value' } ) ;
107
- assert . ok (
110
+ assert . true (
108
111
cookieService . write . calledWith ( 'session-cookie-domain' , JSON . stringify ( { key : 'value' } ) , {
109
112
domain : 'example.com' ,
110
113
expires : null ,
111
114
path : '/' ,
112
115
sameSite : 'Strict' ,
113
116
secure : false ,
117
+ partitioned : null ,
114
118
} )
115
119
) ;
116
120
} ) ;
117
121
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
+
118
146
test ( 'sends a warning when `cookieExpirationTime` is less than 90 seconds' , async function ( assert ) {
119
147
assert . expect ( 2 ) ;
120
148
run ( ( ) => {
@@ -155,7 +183,7 @@ export default function (options) {
155
183
} ) ;
156
184
157
185
test ( 'stores the expiration time in a cookie named "test-session-expiration_time"' , function ( assert ) {
158
- assert . ok (
186
+ assert . true (
159
187
cookieService . write . calledWith (
160
188
'test-session-expiration_time' ,
161
189
60 ,
@@ -212,7 +240,7 @@ export default function (options) {
212
240
await new Promise ( resolve => {
213
241
next ( ( ) => {
214
242
next ( ( ) => {
215
- assert . ok ( triggered ) ;
243
+ assert . true ( triggered ) ;
216
244
resolve ( ) ;
217
245
} ) ;
218
246
} ) ;
@@ -264,11 +292,11 @@ export default function (options) {
264
292
} ) ;
265
293
await store . persist ( { key : 'value' } ) ;
266
294
267
- assert . ok ( cookieService . clear . calledWith ( 'session-foo' ) ) ;
295
+ assert . true ( cookieService . clear . calledWith ( 'session-foo' ) ) ;
268
296
269
- assert . ok ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
297
+ assert . true ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
270
298
271
- assert . ok (
299
+ assert . true (
272
300
cookieService . write . calledWith (
273
301
'session-bar' ,
274
302
JSON . stringify ( { key : 'value' } ) ,
@@ -283,7 +311,7 @@ export default function (options) {
283
311
)
284
312
) ;
285
313
286
- assert . ok (
314
+ assert . true (
287
315
cookieService . write . calledWith (
288
316
'session-bar-expiration_time' ,
289
317
1000 ,
@@ -307,11 +335,11 @@ export default function (options) {
307
335
} ) ;
308
336
await store . persist ( { key : 'value' } ) ;
309
337
310
- assert . ok ( cookieService . clear . calledWith ( defaultName ) ) ;
338
+ assert . true ( cookieService . clear . calledWith ( defaultName ) ) ;
311
339
312
- assert . ok ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
340
+ assert . true ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
313
341
314
- assert . ok (
342
+ assert . true (
315
343
cookieService . write . calledWith (
316
344
'session-bar' ,
317
345
JSON . stringify ( { key : 'value' } ) ,
@@ -336,11 +364,11 @@ export default function (options) {
336
364
} ) ;
337
365
await store . persist ( { key : 'value' } ) ;
338
366
339
- assert . ok ( cookieService . clear . calledWith ( defaultName ) ) ;
367
+ assert . true ( cookieService . clear . calledWith ( defaultName ) ) ;
340
368
341
- assert . ok ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
369
+ assert . true ( cookieService . clear . calledWith ( `${ defaultName } -expiration_time` ) ) ;
342
370
343
- assert . ok (
371
+ assert . true (
344
372
cookieService . write . calledWith (
345
373
'session-bar' ,
346
374
JSON . stringify ( { key : 'value' } ) ,
@@ -364,7 +392,7 @@ export default function (options) {
364
392
365
393
await new Promise ( resolve => {
366
394
next ( ( ) => {
367
- assert . ok ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
395
+ assert . true ( cookieService . clear . calledWith ( 'session-foo-expiration_time' ) ) ;
368
396
resolve ( ) ;
369
397
} ) ;
370
398
} ) ;
@@ -379,7 +407,7 @@ export default function (options) {
379
407
380
408
await new Promise ( resolve => {
381
409
next ( ( ) => {
382
- assert . ok ( cookieSpy . calledOnce ) ;
410
+ assert . true ( cookieSpy . calledOnce ) ;
383
411
resolve ( ) ;
384
412
} ) ;
385
413
} ) ;
0 commit comments