mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-11 18:19:42 +02:00

The entity relation diagram uses uuid v4, which is randomly generated. uuid v5 uses a SHA-1 hash, which makes the uuid deterministic. The input strings are unique for each diagram, so this should be okay.
13 lines
314 B
TypeScript
13 lines
314 B
TypeScript
import { generateId } from './erRenderer';
|
|
|
|
describe('erRenderer', () => {
|
|
describe('generateId', () => {
|
|
it('should be deterministic', () => {
|
|
const id1 = generateId('hello world', 'my-prefix');
|
|
const id2 = generateId('hello world', 'my-prefix');
|
|
|
|
expect(id1).toBe(id2);
|
|
});
|
|
});
|
|
});
|