Skip to content

Commit 7152da4

Browse files
feat: support HTML content from WYSIWYG editor for job content (#3397)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Ido Shamun <idoshamun@users.noreply.github.com>
1 parent bee164b commit 7152da4

7 files changed

Lines changed: 430 additions & 13 deletions

File tree

__mocks__/isomorphic-dompurify.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Mock for isomorphic-dompurify to avoid ESM compatibility issues in Jest
2+
const DOMPurify = {
3+
sanitize: (html: string): string => {
4+
// Simple mock that returns the input - actual sanitization not needed in tests
5+
return html;
6+
},
7+
addHook: (): void => {
8+
// No-op in tests
9+
},
10+
removeHook: (): void => {
11+
// No-op in tests
12+
},
13+
};
14+
15+
export default DOMPurify;

__tests__/schema/opportunity.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4040,7 +4040,7 @@ describe('mutation editOpportunity', () => {
40404040
payload: {
40414041
content: {
40424042
requirements: {
4043-
content: 'Updated requirements *italic*',
4043+
content: '<p>Updated requirements <em>italic</em></p>',
40444044
},
40454045
},
40464046
},
@@ -4054,8 +4054,8 @@ describe('mutation editOpportunity', () => {
40544054
html: '<p>We are looking for a Senior Full Stack Developer...</p>',
40554055
},
40564056
requirements: {
4057-
content: 'Updated requirements *italic*',
4058-
html: '<p>Updated requirements <em>italic</em></p>\n',
4057+
content: '<p>Updated requirements <em>italic</em></p>',
4058+
html: '<p>Updated requirements <em>italic</em></p>',
40594059
},
40604060
});
40614061

@@ -4068,8 +4068,8 @@ describe('mutation editOpportunity', () => {
40684068
html: '<p>We are looking for a Senior Full Stack Developer...</p>',
40694069
},
40704070
requirements: {
4071-
content: 'Updated requirements *italic*',
4072-
html: '<p>Updated requirements <em>italic</em></p>\n',
4071+
content: '<p>Updated requirements <em>italic</em></p>',
4072+
html: '<p>Updated requirements <em>italic</em></p>',
40734073
},
40744074
});
40754075
});

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ module.exports = {
3939
},
4040
moduleNameMapper: {
4141
'^file-type$': '<rootDir>/node_modules/file-type/index.js',
42+
'^isomorphic-dompurify$': '<rootDir>/__mocks__/isomorphic-dompurify.ts',
4243
},
4344
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"ioredis": "^5.7.0",
118118
"is-in-subnet": "^4.0.1",
119119
"isbot": "^5.1.30",
120+
"isomorphic-dompurify": "^2.35.0",
120121
"jsonexport": "^3.2.0",
121122
"jsonwebtoken": "^9.0.2",
122123
"lodash": "^4.17.21",

0 commit comments

Comments
 (0)