@@ -5,20 +5,34 @@ const indexPage = new IndexPage()
55
66const basicEdgeFn = `const processSignal = (signal) => {}`
77
8- test ( 'ingestion not enabled -> will not send the signal' , async ( { page } ) => {
9- await indexPage . loadAndWait ( page , basicEdgeFn , {
10- enableSignalsIngestion : false ,
11- flushAt : 1 ,
12- } )
8+ test ( 'debug ingestion disabled and sample rate 0 -> will not send the signal' , async ( {
9+ page,
10+ } ) => {
11+ await indexPage . loadAndWait (
12+ page ,
13+ basicEdgeFn ,
14+ {
15+ enableSignalsIngestion : false ,
16+ flushAt : 1 ,
17+ } ,
18+ { sampleRate : 0 }
19+ )
1320 await indexPage . fillNameInput ( 'John Doe' )
1421 await page . waitForTimeout ( 100 )
1522 expect ( indexPage . signalsAPI . getEvents ( 'interaction' ) ) . toHaveLength ( 0 )
1623} )
1724
18- test ( 'ingestion enabled -> will send the signal' , async ( { page } ) => {
19- await indexPage . loadAndWait ( page , basicEdgeFn , {
20- enableSignalsIngestion : true ,
21- } )
25+ test ( 'debug ingestion enabled and sample rate 0 -> will send the signal' , async ( {
26+ page,
27+ } ) => {
28+ await indexPage . loadAndWait (
29+ page ,
30+ basicEdgeFn ,
31+ {
32+ enableSignalsIngestion : true ,
33+ } ,
34+ { sampleRate : 0 }
35+ )
2236
2337 await Promise . all ( [
2438 indexPage . fillNameInput ( 'John Doe' ) ,
@@ -28,24 +42,9 @@ test('ingestion enabled -> will send the signal', async ({ page }) => {
2842 expect ( true ) . toBe ( true )
2943} )
3044
31- test ( 'never sends signal when sample rate is 0' , async ( { page } ) => {
32- await indexPage . loadAndWait (
33- page ,
34- basicEdgeFn ,
35- {
36- flushAt : 1 ,
37- enableSignalsIngestion : false ,
38- } ,
39- {
40- sampleRate : 0 ,
41- }
42- )
43- await indexPage . fillNameInput ( 'John Doe' )
44- await page . waitForTimeout ( 100 )
45- expect ( indexPage . signalsAPI . getEvents ( 'interaction' ) ) . toHaveLength ( 0 )
46- } )
47-
48- test ( 'always sends signal when sample rate is 1' , async ( { page } ) => {
45+ test ( 'debug ingestion disabled and sample rate 1 -> will send the signal' , async ( {
46+ page,
47+ } ) => {
4948 await indexPage . loadAndWait (
5049 page ,
5150 basicEdgeFn ,
0 commit comments