Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
/**
* Mock of the object returned by the Cloudinary createMediaLibrary method.
*/
mediaLibrary = {
show: jest.fn(),
hide: jest.fn(),
};
/**
* We load the Cloudinary library by injecting a script tag to the page
* head. Initialization waits for the script to load, so here we fake it.
* This also tests that the expected script is added to the DOM.
*/
waitForElement(() => {
const url = 'https://media-library.cloudinary.com/global/all.js';
return queryHelpers.queryByAttribute('src', document, url);
}).then(script => {
cloudinaryScript = script;
script.onreadystatechange();
});
});