Add test
This commit is contained in:
parent
7489ee8174
commit
21c42cbe12
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue