We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a94ed3d commit c013b6eCopy full SHA for c013b6e
1 file changed
test/renderer/utils/stringUtils.test.ts
@@ -6,8 +6,13 @@ const UUID_V4_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}
6
7
describe('generateUUID', () => {
8
it('delegates to crypto.randomUUID when available', () => {
9
+ const KNOWN_UUID = '12345678-1234-4234-8234-123456789abc';
10
+ const spy = vi.spyOn(crypto, 'randomUUID').mockReturnValue(KNOWN_UUID);
11
const result = generateUUID();
12
+ expect(spy).toHaveBeenCalled();
13
+ expect(result).toBe(KNOWN_UUID);
14
expect(result).toMatch(UUID_V4_PATTERN);
15
+ spy.mockRestore();
16
});
17
18
describe('getRandomValues fallback (non-secure context)', () => {
0 commit comments