move internal stuff in _, add unique id for each widget

This commit is contained in:
Géry Debongnie
2019-01-25 14:27:16 +01:00
parent c1dd38bf03
commit 9fc7cf0c68
5 changed files with 60 additions and 21 deletions
+10 -1
View File
@@ -1,4 +1,4 @@
import { escape, htmlTrim } from "../src/ts/core/utils";
import { escape, htmlTrim, idGenerator } from "../src/ts/core/utils";
describe("escape", () => {
test("normal strings", () => {
@@ -25,3 +25,12 @@ describe("htmlTrim", () => {
expect(htmlTrim("")).toBe("");
});
});
describe("idGenerator", () => {
test("basic use", () => {
let gen = idGenerator();
expect(gen()).toBe(1);
expect(gen()).toBe(2);
expect(gen()).toBe(3);
});
});