Skip to content

Commit

Permalink
Integrated priority option into setCookie serialization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyondo committed Dec 22, 2024
1 parent e1b65a3 commit 3f0e470
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils/cookie.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ describe('Set cookie', () => {
maxAge: 1000,
expires: new Date(Date.UTC(2000, 11, 24, 10, 30, 59, 900)),
sameSite: 'Strict',
priority: 'High',
partitioned: true,
})
expect(serialized).toBe(
'__Secure-great_cookie=banana; Max-Age=1000; Domain=example.com; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSite=Strict; Partitioned'
'__Secure-great_cookie=banana; Max-Age=1000; Domain=example.com; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSite=Strict; Priority=High; Partitioned'
)
})

Expand All @@ -185,10 +186,11 @@ describe('Set cookie', () => {
maxAge: 1000,
expires: new Date(Date.UTC(2000, 11, 24, 10, 30, 59, 900)),
sameSite: 'Strict',
priority: 'High',
partitioned: true,
})
expect(serialized).toBe(
'__Host-great_cookie=banana; Max-Age=1000; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSite=Strict; Partitioned'
'__Host-great_cookie=banana; Max-Age=1000; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSite=Strict; Priority=High; Partitioned'
)
})

Expand All @@ -210,10 +212,11 @@ describe('Set cookie', () => {
maxAge: 1000,
expires: new Date(Date.UTC(2000, 11, 24, 10, 30, 59, 900)),
sameSite: 'Strict',
priority: 'High',
partitioned: true,
})
expect(serialized).toBe(
'great_cookie=banana.hSo6gB7YT2db0WBiEAakEmh7dtwEL0DSp76G23WvHuQ%3D; Max-Age=1000; Domain=example.com; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSite=Strict; Partitioned'
'great_cookie=banana.hSo6gB7YT2db0WBiEAakEmh7dtwEL0DSp76G23WvHuQ%3D; Max-Age=1000; Domain=example.com; Path=/; Expires=Sun, 24 Dec 2000 10:30:59 GMT; HttpOnly; Secure; SameSite=Strict; Priority=High; Partitioned'
)
})

Expand Down

0 comments on commit 3f0e470

Please sign in to comment.