fix(er): switch to deterministic uuids in ER

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.
This commit is contained in:
Alois Klink
2022-12-15 00:01:29 +00:00
parent ff7ed7f49f
commit ac5a1b4501
2 changed files with 25 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
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);
});
});
});