From 21dc4d4808818cda667c5bb4af8342f87728e0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstr=C3=B6m?= Date: Wed, 9 Oct 2024 18:19:15 +0100 Subject: [PATCH] fix: don't account for empty attributes --- src/detector.impressions.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/detector.impressions.test.ts b/src/detector.impressions.test.ts index df8ec57..1143b03 100644 --- a/src/detector.impressions.test.ts +++ b/src/detector.impressions.test.ts @@ -34,3 +34,19 @@ test("check impresssions", async () => { }, ]); }); + +test("don\'t consider empty attributes", async () => { + window.TS = { + token: "token", + }; + const events: any[] = []; + window.addEventListener("topsort", (e) => { + events.push((e as any).detail); + }); + document.body.innerHTML = ` +
+ `; + await import("./detector"); + + expect(events).toMatchObject([]); +});