uncloseai.com/tests/__mocks__/hljs.js
Russell Ballestrini c721b88473 fix: add fallback handling for window modal functions in embed modal
- Add safety checks for window.openTTSModal and window.openTranslateModal availability
- Implement fallback dynamic imports if window functions not available
- Prevents "window.openTTSModal is not a function" and "window.openTranslateModal is not a function" errors
- Provides graceful error handling with user feedback if modal imports fail
- Resolves loading order dependency issues between ui.js and embed modal

This ensures modal buttons work regardless of script loading order.
2025-07-03 18:51:48 -04:00

6 lines
No EOL
167 B
JavaScript

// Mock for highlight.js library
export default {
highlightElement: jest.fn(),
highlightAll: jest.fn(),
highlight: jest.fn((lang, code) => ({ value: code })),
};