From 69ea56536ece83c1e8fab5c4b33d58b040cdd0a5 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Tue, 7 Jan 2025 23:05:38 +0100 Subject: [PATCH] maint(core uuid): Extend with documentation and test from thet-own-needs with similar changes. --- src/core/dom.js | 2 +- src/core/uuid.test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/dom.js b/src/core/dom.js index 80bd3e6ad..ad3c42659 100644 --- a/src/core/dom.js +++ b/src/core/dom.js @@ -532,7 +532,7 @@ const escape_css_id = (id) => { }; /** - * Get a universally unique id (uuid) for a DOM element. + * Set and get a universally unique id (uuid) for a DOM element. * * This method returns a uuid for the given element. On the first call it will * generate a uuid and store it on the element. diff --git a/src/core/uuid.test.js b/src/core/uuid.test.js index d70c337a0..fdfd74f7b 100644 --- a/src/core/uuid.test.js +++ b/src/core/uuid.test.js @@ -19,4 +19,8 @@ describe("uuid", function () { window.crypto.randomUUID = orig_randomUUID; }); + + it("the uuid is unique", function () { + expect(create_uuid()).not.toBe(create_uuid()); + }); });