From 839fdbca625f4aa0644a6e9ab99c49ad252897f2 Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 15 Sep 2021 13:55:34 +0100 Subject: [PATCH] fix tests --- test/PosthogAnalytics-test.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/PosthogAnalytics-test.ts b/test/PosthogAnalytics-test.ts index f8bf79702a..65af8b51f3 100644 --- a/test/PosthogAnalytics-test.ts +++ b/test/PosthogAnalytics-test.ts @@ -168,31 +168,25 @@ describe("PosthogAnalytics", () => { it("Should pseudonymise a location of a known screen", async () => { const location = await getRedactedCurrentLocation( "https://foo.bar", "#/register/some/pii", "/", Anonymity.Pseudonymous); - expect(location).toBe( - `https://foo.bar/#/register/\ -a6b46dd0d1ae5e86cbc8f37e75ceeb6760230c1ca4ffbcb0c97b96dd7d9c464b/\ -bd75b3e080945674c0351f75e0db33d1e90986fa07b318ea7edf776f5eef38d4`); + expect(location).toBe("https://foo.bar/#/register/"); }); it("Should anonymise a location of a known screen", async () => { const location = await getRedactedCurrentLocation( "https://foo.bar", "#/register/some/pii", "/", Anonymity.Anonymous); - expect(location).toBe("https://foo.bar/#/register//"); + expect(location).toBe("https://foo.bar/#/register/"); }); it("Should pseudonymise a location of an unknown screen", async () => { const location = await getRedactedCurrentLocation( "https://foo.bar", "#/not_a_screen_name/some/pii", "/", Anonymity.Pseudonymous); - expect(location).toBe( - `https://foo.bar/#//\ -a6b46dd0d1ae5e86cbc8f37e75ceeb6760230c1ca4ffbcb0c97b96dd7d9c464b/\ -bd75b3e080945674c0351f75e0db33d1e90986fa07b318ea7edf776f5eef38d4`); + expect(location).toBe("https://foo.bar/#//"); }); it("Should anonymise a location of an unknown screen", async () => { const location = await getRedactedCurrentLocation( "https://foo.bar", "#/not_a_screen_name/some/pii", "/", Anonymity.Anonymous); - expect(location).toBe("https://foo.bar/#///"); + expect(location).toBe("https://foo.bar/#//"); }); it("Should handle an empty hash", async () => {