2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-21 17:00:34 +03:00

feat: add option waitOnDestroyed

This commit is contained in:
pimlie
2019-09-17 13:30:08 +02:00
committed by Pim
parent d43b77cce6
commit f745059270
7 changed files with 102 additions and 19 deletions
+20
View File
@@ -263,4 +263,24 @@ describe('plugin', () => {
jest.advanceTimersByTime(10)
expect(refreshSpy).toHaveBeenCalled()
})
test('can set option waitOnDestroyed runtime', () => {
const wrapper = mount({ render: h => h('div') }, { localVue: Vue })
expect(wrapper.vm.$meta().getOptions().waitOnDestroyed).toBe(true)
wrapper.vm.$meta().setOptions({ waitOnDestroyed: false })
expect(wrapper.vm.$meta().getOptions().waitOnDestroyed).toBe(false)
})
test('can set option debounceWait runtime', () => {
const wrapper = mount({ render: h => h('div') }, { localVue: Vue })
expect(wrapper.vm.$meta().getOptions().debounceWait).toBe(10)
wrapper.vm.$meta().setOptions({ debounceWait: 69420 })
expect(wrapper.vm.$meta().getOptions().debounceWait).toBe(69420)
})
})