diff --git a/packages/rum-core/src/domain/action/computeFrustration.spec.ts b/packages/rum-core/src/domain/action/computeFrustration.spec.ts index fad5cee0b3..c97bf79097 100644 --- a/packages/rum-core/src/domain/action/computeFrustration.spec.ts +++ b/packages/rum-core/src/domain/action/computeFrustration.spec.ts @@ -68,6 +68,13 @@ describe('computeFrustration', () => { expect(getFrustrations(clicks[1])).toEqual([]) }) + it('does not add a dead frustration when clicking to scroll', () => { + clicks[0] = createFakeClick({ userActivity: { scroll: true } }) + clicks[1] = createFakeClick() + computeFrustration(clicks, rageClick) + expect(getFrustrations(clicks[1])).toEqual([]) + }) + it('adds an error frustration to clicks that have an error', () => { clicks[1] = createFakeClick({ hasError: true }) computeFrustration(clicks, rageClick) @@ -101,6 +108,12 @@ describe('isRage', () => { ) }) + it('does not consider rage when at least one click is related to a "scroll" event', () => { + expect(isRage([createFakeClick(), createFakeClick({ userActivity: { scroll: true } }), createFakeClick()])).toBe( + false + ) + }) + it('does not consider as rage two clicks happening at the same time', () => { expect(isRage([createFakeClick(), createFakeClick()])).toBe(false) }) @@ -143,6 +156,10 @@ describe('isDead', () => { expect(isDead(createFakeClick({ hasPageActivity: false, userActivity: { input: true } }))).toBe(false) }) + it('does not consider as dead when the click is related to a "scroll" event', () => { + expect(isDead(createFakeClick({ hasPageActivity: false, userActivity: { scroll: true } }))).toBe(false) + }) + for (const { element, expected } of [ { element: '', expected: false }, { element: '