elementor/packages/jest.config.js
Maksim Zubov 9159a20ff8
Internal: Add Mixpanel Events to the onboarding 2.0 [ED-22732] (#34984)
## PR Checklist
<!-- 
Please check if your PR fulfills the following requirements:
**Filling out the template is required.** Any pull request that does not
include enough information to be reviewed in a timely manner may be
closed at the maintainers' discretion.
 -->
- [ ] The commit message follows our guidelines:
https://github.com/elementor/elementor/blob/master/.github/CONTRIBUTING.md
<img width="1666" height="828" alt="image"
src="https://github.com/user-attachments/assets/ceecefaf-f90d-40b2-b9e8-95887f347357"
/>


## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x" with no
spaces eg: [x]. -->
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:

## Summary

This PR can be summarized in the following changelog entry:

*

## Description
An explanation of what is done in this PR

*

## Test instructions
This PR can be tested by following these steps:

*

## Quality assurance

- [ ] I have tested this code to the best of my abilities
- [ ] I have added unittests to verify the code works as intended
- [ ] Docs have been added / updated (for bug fixes / features)

Fixes #

<!--start_gitstream_placeholder-->
###  PR Description
Purpose: Add comprehensive Mixpanel event tracking to onboarding 2.0
flow to capture user interactions, choices, and funnel progression for
analytics.

Main changes:
- Implemented complete analytics infrastructure with event queue,
tracking context, and 18 event types covering initialization, step
views, user choices, and errors
- Integrated tracking hooks into onboarding components to capture
persona selection, site topics, theme choices, Pro features, and
navigation actions
- Added Mixpanel instance management with conditional activation based
on user consent and connection status, including queue flushing on
activation

_Generated by LinearB AI and added by gitStream._
<sub>AI-generated content may contain inaccuracies. Please verify before
using.
💡 **Tip:** You can customize your AI Description using **Guidelines**
[Learn
how](https://docs.gitstream.cm/automation-actions/#describe-changes)</sub>
<!--end_gitstream_placeholder-->

---------

Co-authored-by: ElementorBot <48412871+elementorbot@users.noreply.github.com>
Co-authored-by: Hein van Vlastuin <94352322+hein-obox@users.noreply.github.com>
2026-03-10 09:20:56 +00:00

35 lines
1.1 KiB
JavaScript

module.exports = {
verbose: true,
rootDir: __dirname,
testEnvironment: 'jsdom',
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
},
moduleNameMapper: {
'^@elementor/(?!ui|icons|design-tokens)(.*)$': [
'<rootDir>/packages/core/$1/src',
'<rootDir>/packages/libs/$1/src',
'<rootDir>/packages/tools/$1/src',
],
},
// By default, jest will treat everything under `__tests__` as a test file, we only need `__tests__/*.test.ts`.
testMatch: [
'<rootDir>/packages/**/__tests__/**/*.test.[jt]s?(x)',
'<rootDir>/apps/**/__tests__/**/*.test.[jt]s?(x)',
],
// Setup files to run for all the tests.
setupFilesAfterEnv: [ '<rootDir>/tests/setup.ts' ],
// Code coverage.
collectCoverageFrom: [
'packages/**/*.{js,jsx,ts,tsx}',
'!packages/**/__tests__/**/*.{js,jsx,ts,tsx}', // Avoid running coverage on test utils.
'!packages/**/dist/**/*.{js,jsx,ts,tsx}', // Avoid running coverage on dist.
'!packages/**/typedoc.config.js', // Avoid running coverage on typedoc config.
],
moduleDirectories: [ 'node_modules', 'tests' ],
coverageThreshold: {
global: {
lines: 80,
},
},
};