We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10dea7d commit a5ebb3dCopy full SHA for a5ebb3d
src/__tests__/utils/cookieUtils.test.ts
@@ -0,0 +1,7 @@
1
+import { describe, it, expect, beforeEach } from 'vitest';
2
+import { getCookie, setCookie, deleteCookie, getAllCookies } from '../../utils/cookieUtils';
3
+describe('cookieUtils', () => {
4
+ beforeEach(() => { Object.defineProperty(document, 'cookie', { value: '', writable: true }); });
5
+ it('getCookie returns null for missing cookies', () => { expect(getCookie('nonexistent')).toBeNull(); });
6
+ it('getAllCookies returns object', () => { expect(typeof getAllCookies()).toBe('object'); });
7
+});
0 commit comments