feat: mask date of birth

This commit is contained in:
Michael Zetterberg
2024-08-27 10:55:46 +02:00
parent 68aa6e565d
commit ce3248562b
3 changed files with 19 additions and 3 deletions
+6 -1
View File
@@ -1,6 +1,6 @@
import { describe, expect, test } from "@jest/globals"
import { email, phone, text } from "./maskValue"
import { all, email, phone, text } from "./maskValue"
describe("Mask value", () => {
test("masks e-mails properly", () => {
@@ -19,4 +19,9 @@ describe("Mask value", () => {
expect(text("test")).toBe("t***")
expect(text("test.with.dot")).toBe("t************")
})
test("masks whole string properly", () => {
expect(all("test")).toBe("****")
expect(all("123jknasd@iajsd.c")).toBe("*****************")
})
})