1
0
mirror of https://github.com/Safe-Support-Chat/ocrcc-chatbox synced 2025-04-10 06:03:43 +00:00
ocrcc-chatbox/src/outputs/bookmarklet.test.js
Sharon Kennedy c5b15034eb update tests
2020-04-29 11:31:23 -04:00

19 lines
537 B
JavaScript

import ReactDOM from 'react-dom';
import bookmarklet from './bookmarklet';
describe('bookmarklet', () => {
afterEach(() => {
const el = document.querySelectorAll('body > div');
ReactDOM.unmountComponentAtNode(el[0]);
el[0].parentNode.removeChild(el[0]);
window.EmbeddableChatbox = null;
});
test('#mount document becomes ready', async () => {
expect(window.EmbeddableChatbox).not.toBeNull();
bookmarklet();
const el = document.querySelectorAll('body > div');
expect(el).toHaveLength(1);
});
});