@@ -25,13 +25,11 @@ test.describe("General Tracking", () => {
2525 expect ( tracker . clientId ) . toBe ( "test-client-id" ) ;
2626 } ) ;
2727
28- test ( "initializes via data- attributes (classic script) " , async ( { page } ) => {
28+ test ( "initializes via data- attributes" , async ( { page } ) => {
2929 await page . goto ( "/" ) ;
30- // We inject a script tag manually to simulate classic script usage with data attributes
3130 await page . evaluate ( ( ) => {
3231 const script = document . createElement ( 'script' ) ;
3332 script . src = "/dist/databuddy.js" ;
34- script . type = "module" ;
3533 script . setAttribute ( "data-client-id" , "data-attr-client" ) ;
3634 script . setAttribute ( "data-ignore-bot-detection" , "true" ) ;
3735 document . body . appendChild ( script ) ;
@@ -44,14 +42,11 @@ test.describe("General Tracking", () => {
4442 expect ( tracker . ignoreBotDetection ) . toBe ( true ) ;
4543 } ) ;
4644
47- test ( "initializes via query parameters (classic script) " , async ( { page } ) => {
45+ test ( "initializes via query parameters" , async ( { page } ) => {
4846 await page . goto ( "/" ) ;
49- // We inject a script tag manually to simulate classic script usage with query params
5047 await page . evaluate ( ( ) => {
5148 const script = document . createElement ( 'script' ) ;
5249 script . src = "/dist/databuddy.js?clientId=query-param-client&ignoreBotDetection=true" ;
53- // Since build outputs ESM, we need to treat it as a module
54- script . type = "module" ;
5550 document . body . appendChild ( script ) ;
5651 } ) ;
5752
@@ -76,7 +71,6 @@ test.describe("General Tracking", () => {
7671 await page . evaluate ( ( ) => {
7772 ( window as any ) . databuddyConfig = { clientId : "test-client-id" , ignoreBotDetection : true } ;
7873 } ) ;
79- // Ensure module type
8074 await page . addScriptTag ( { url : "/dist/databuddy.js" } ) ;
8175
8276 const request = await requestPromise ;
@@ -92,7 +86,6 @@ test.describe("General Tracking", () => {
9286 await page . evaluate ( ( ) => {
9387 ( window as any ) . databuddyConfig = { clientId : "test-client-id" , ignoreBotDetection : true } ;
9488 } ) ;
95- // Ensure module type
9689 await page . addScriptTag ( { url : "/dist/databuddy.js" } ) ;
9790
9891 await expect . poll ( async ( ) => await page . evaluate ( ( ) => ! ! ( window as any ) . db ) ) . toBeTruthy ( ) ;
@@ -131,7 +124,6 @@ test.describe("General Tracking", () => {
131124 await page . evaluate ( ( ) => {
132125 ( window as any ) . databuddyConfig = { clientId : "test-client-id" } ; // ignoreBotDetection defaults to false
133126 } ) ;
134- // Ensure module type
135127 await page . addScriptTag ( { url : "/dist/databuddy.js" } ) ;
136128
137129 // Wait a bit to ensure no request is fired
0 commit comments