Skip to content

Commit 59b6162

Browse files
alemagioAkryum
authored andcommitted
test: test #366 for destroyTooltip (#367)
1 parent 4055d70 commit 59b6162

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/directives/v-tooltip.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as VTooltip from './v-tooltip'
2+
import { destroyTooltip } from './v-tooltip'
23

34
jest.mock('../lib/tooltip')
45

@@ -92,3 +93,21 @@ describe('getOptions', () => {
9293
})
9394
})
9495
})
96+
97+
describe('destroyTooltip', () => {
98+
test('is deleted', () => {
99+
const dispose = jest.fn(x => null)
100+
const el = {
101+
_tooltip: {
102+
dispose: dispose,
103+
},
104+
_tooltipOldShow: {},
105+
}
106+
107+
VTooltip.destroyTooltip(el)
108+
109+
expect(dispose.mock.calls.length).toBe(1)
110+
expect(el._tooltip).toBeUndefined()
111+
expect(el._tooltipOldShow).toBeUndefined()
112+
})
113+
})

0 commit comments

Comments
 (0)