fix tests

This commit is contained in:
Sharon Kennedy
2020-03-27 18:21:13 -04:00
parent 3fd9c7365d
commit 3f2aa3a9db
8 changed files with 65 additions and 9 deletions

View File

@@ -2,6 +2,13 @@ import ReactDOM from 'react-dom';
import bookmarklet from './bookmarklet';
describe('bookmarklet', () => {
beforeAll(() => {
const el = document.querySelectorAll('body > div');
ReactDOM.unmountComponentAtNode(el[0]);
el[0].parentNode.removeChild(el[0]);
window.EmbeddableChatbox = null;
})
afterEach(() => {
const el = document.querySelectorAll('body > div');
ReactDOM.unmountComponentAtNode(el[0]);

View File

@@ -1,8 +1,15 @@
import EmbeddableChatbox from './embeddable-chatbox';
import { waitForSelection } from '../test-helpers';
import { waitForSelection } from '../utils/test-helpers';
describe('EmbeddableChatbox', () => {
beforeAll(() => {
document.readyState = 'complete';
if (EmbeddableChatbox.el) {
EmbeddableChatbox.unmount();
}
});
afterEach(() => {
document.readyState = 'complete';
if (EmbeddableChatbox.el) {