This commit is contained in:
Steve Ruiz 2021-09-08 12:55:42 +01:00
parent 7489ee8174
commit 21c42cbe12

View file

@ -6,4 +6,14 @@ describe('tldraw', () => {
test('mounts component without crashing', () => {
render(<TLDraw />)
})
test('mounts component and calls onMount', (done) => {
const onMount = jest.fn()
render(<TLDraw onMount={onMount} />)
// The call is asynchronous: it won't be called until the next tick.
setTimeout(() => {
expect(onMount).toHaveBeenCalled()
done()
}, 100)
})
})