uncloseai.com/tests/__mocks__/marked.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

5 lines
No EOL
130 B
JavaScript

// Mock for marked library
export const marked = {
parse: jest.fn((content) => `<p>${content}</p>`),
setOptions: jest.fn(),
};