Skip to content

Commit 61d52cb

Browse files
committed
Tests: Add Jest tests for JSX parser, HOCs, and post locking utilities
Add unit tests for security-critical JSX parsing functionality with structural assertions that verify actual output values rather than just checking existence. - jsx-parser.test.js: 35 tests covering HTML parsing, attribute conversion, InnerBlocks handling, script tags, and XSS vector documentation - setup-tests.js: Extended with wp global (blockEditor, element, data) and acf mock (isget, applyFilters, strCamelCase, jsxNameReplacements) - mocks/jquery.js: DOM parsing mock using DOMParser for jsx-parser tests - jest.config.js: Added jQuery module mapping 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 7551a70 commit 61d52cb

File tree

4 files changed

+430
-138
lines changed

4 files changed

+430
-138
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
testEnvironment: 'jsdom',
99
moduleNameMapper: {
1010
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
11+
'^jquery$': '<rootDir>/tests/js/mocks/jquery.js',
1112
},
1213
collectCoverageFrom: [
1314
'assets/src/js/**/*.{js,jsx}',

0 commit comments

Comments
 (0)