Skip to content

Commit a5ebb3d

Browse files
committed
test(utils): add cookieUtils tests
1 parent 10dea7d commit a5ebb3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)