Skip to content

Commit

Permalink
test: Add test case for Dom.Event.off bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cluezhang committed Nov 6, 2023
1 parent 4a872a0 commit aa3ddb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/x6-common/src/__tests__/dom/event.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,16 @@ describe('EventDom', () => {
expect(() => div.off('click', false)).not.toThrowError()
})

it('should do noting for elem which do not bind any events', () => {
it('should do nothing for elem which do not bind any events', () => {
const div = new EventDom()
expect(() => div.off()).not.toThrowError()
})

it('should do nothing for unexist event', () => {
const div = new EventDom()
div.on('whatever', () => {})
expect(() => div.off('unexist')).not.toThrowError()
})
})

describe('trigger()', () => {
Expand Down

0 comments on commit aa3ddb7

Please sign in to comment.