SHIVANSH-ux-ys opened a new pull request, #1628: URL: https://github.com/apache/camel-website/pull/1628
Closes #1481 ## Summary This PR adds a complete unit testing setup using **Jest** with for the JavaScript files in . ## Changes ### New Files - — Jest configuration using jsdom environment - — Tests for navigation module - — Tests for clipboard module - — Tests for search module ### Modified Files - — Added `jest` and `jest-environment-jsdom` dev dependencies, added `test` script ## Test Results ``` PASS src/js/__tests__/06-copy-to-clipboard.test.js PASS src/js/__tests__/01-nav.test.js PASS src/js/__tests__/99-nav-search.test.js Test Suites: 3 passed, 3 total Tests: 28 passed, 28 total Time: 0.4 s ``` ## Coverage - **01-nav.js** — find helper, findNextElement helper, showNav/hideNav DOM behavior, toggleActive, activateCurrentPath - **06-copy-to-clipboard.js** — extractCommands regex, trimTrailingSpaces, DOM setup (toolbox, copy button, toast) - **99-nav-search.js** — tokenize helper, buildSearchRegex, DOM filtering (add/remove filtered class) -- 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]
