mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
23 lines
597 B
TypeScript
23 lines
597 B
TypeScript
import ReactDOM from 'react-dom'
|
|
import { renderToDOM } from './index'
|
|
|
|
describe('test ReactDOM.render', () => {
|
|
const originalRender = ReactDOM.render
|
|
const originalGetElement = global.document.getElementById
|
|
|
|
beforeEach(() => {
|
|
global.document.getElementById = () => true
|
|
ReactDOM.render = jest.fn()
|
|
})
|
|
|
|
afterAll(() => {
|
|
global.document.getElementById = originalGetElement
|
|
ReactDOM.render = originalRender
|
|
})
|
|
|
|
it('should call ReactDOM.render', () => {
|
|
renderToDOM()
|
|
expect(ReactDOM.render).toHaveBeenCalled()
|
|
})
|
|
})
|