From 2b40820b7373602bf715db22757e0618ef2f205f Mon Sep 17 00:00:00 2001 From: Ayoub-Mabrouk Date: Sat, 20 Dec 2025 23:02:27 +0100 Subject: [PATCH] test: add sameSite property tests for Cookie class --- test/cookie.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/cookie.js b/test/cookie.js index ea676e35..2f7a6725 100644 --- a/test/cookie.js +++ b/test/cookie.js @@ -130,5 +130,31 @@ describe('new Cookie()', function () { assert.strictEqual(cookie.priority, 'high') }) }) + + describe('sameSite', function () { + it('should set sameSite', function () { + var cookie = new Cookie({ sameSite: 'strict' }) + + assert.strictEqual(cookie.sameSite, 'strict') + }) + + it('should accept "lax" value', function () { + var cookie = new Cookie({ sameSite: 'lax' }) + + assert.strictEqual(cookie.sameSite, 'lax') + }) + + it('should accept "none" value', function () { + var cookie = new Cookie({ sameSite: 'none' }) + + assert.strictEqual(cookie.sameSite, 'none') + }) + + it('should default to undefined', function () { + var cookie = new Cookie() + + assert.strictEqual(cookie.sameSite, undefined) + }) + }) }) })