Brijesh619 opened a new pull request, #732:
URL: https://github.com/apache/atlas/pull/732

   ## What changes were proposed in this pull request?
   
   This PR resolves **ATLAS-5383** by upgrading the `sanitize-html` dependency 
in the Atlas React UI (`/dashboard`) to version `2.17.6`. 
   
   Upgrading this package introduces a known Jest environment error because its 
underlying transitive dependency (`htmlparser2`) has switched to ESM syntax, 
which the default Jest test runner fails to parse natively. To safely perform 
this upgrade while keeping the test suite green, this PR includes the following 
changes:
   
   1. **`package.json` / `package-lock.json`**: Bumped `sanitize-html` to 
`2.17.6`.
   2. **`src/__mocks__/sanitize-html.ts`**: Created a simple Jest module mock 
that safely bypasses the ESM crash during tests.
   3. **`jest.config.js`**: Added a `moduleNameMapper` configuration to 
correctly map `sanitize-html` to our new mock file during test execution.
   
   ## How was this patch tested?
   
   **Build & Type Tests:**
   * Ran `npm install` and `npm run build` to ensure the React UI compiles 
successfully without any build regressions.
   * Ran `npm run typecheck` and `npm run lint`.
   
   **Unit Tests (Resolving the ESM crash):**
   * Ran `npm run test` across the entire `/dashboard` directory. Verified that 
the new Jest mock successfully intercepts the ESM imports and that all 189 test 
suites and 4,790 tests pass with a 100% success rate.
   
   **Manual UI Verification:**
   * Started the local Vite dev server and verified that the UI loads and 
functions as expected in the browser (which ignores Jest mocks and uses the 
real, upgraded `sanitize-html` package for production filtering).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to