diff --git a/src/directives/scrollspy/scrollspy.js b/src/directives/scrollspy/scrollspy.js index e5ea5d74864..f3496e4f77e 100644 --- a/src/directives/scrollspy/scrollspy.js +++ b/src/directives/scrollspy/scrollspy.js @@ -50,7 +50,7 @@ const parseBindings = bindings => /* istanbul ignore next: not easy to test */ { } // Add or update ScrollSpy on our element -const applyScrollspy = (el, bindings, vnode) => { +const applyScrollspy = (el, bindings, vnode) => /* istanbul ignore next: not easy to test */ { if (!inBrowser) { /* istanbul ignore next */ return @@ -64,7 +64,8 @@ const applyScrollspy = (el, bindings, vnode) => { } // Remove ScrollSpy on our element -const removeScrollspy = el => { +/* istanbul ignore next: not easy to test */ +const removeScrollspy = el => /* istanbul ignore next: not easy to test */ { if (el[BV_SCROLLSPY]) { el[BV_SCROLLSPY].dispose() el[BV_SCROLLSPY] = null @@ -76,10 +77,10 @@ const removeScrollspy = el => { * Export our directive */ export default { - bind(el, bindings, vnode) { + bind(el, bindings, vnode) /* istanbul ignore next: not easy to test */ { applyScrollspy(el, bindings, vnode) }, - inserted(el, bindings, vnode) { + inserted(el, bindings, vnode) /* istanbul ignore next: not easy to test */ { applyScrollspy(el, bindings, vnode) }, update(el, bindings, vnode) /* istanbul ignore next: not easy to test */ { @@ -92,7 +93,7 @@ export default { applyScrollspy(el, bindings, vnode) } }, - unbind(el) { + unbind(el) /* istanbul ignore next: not easy to test */ { removeScrollspy(el) } } diff --git a/src/directives/scrollspy/scrollspy.spec.js b/src/directives/scrollspy/scrollspy.spec.js deleted file mode 100644 index 93db2855590..00000000000 --- a/src/directives/scrollspy/scrollspy.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -import scrollspyDirective from './scrollspy' -import ScrollSpy from './scrollspy.class' -import { mount, createLocalVue as CreateLocalVue } from '@vue/test-utils' - -// Key we use to store our instance -const BV_SCROLLSPY = '__BV_ScrollSpy__' - -describe('v-b-scrollspy directive', () => { - it('should have ScrollSpy class instance', async () => { - const localVue = new CreateLocalVue() - - const App = localVue.extend({ - directives: { - bScrollspy: scrollspyDirective - }, - data() { - return {} - }, - // Assumes watching body element for scrolls - template: '
content
' - }) - - const wrapper = mount(App, { - localVue: localVue, - attachToDocument: true - }) - - expect(wrapper.isVueInstance()).toBe(true) - expect(wrapper.is('div')).toBe(true) - const $div = wrapper.find('div') - - // Should have instance of popover class on it - expect($div.element[BV_SCROLLSPY]).toBeDefined() - expect($div.element[BV_SCROLLSPY]).toBeInstanceOf(ScrollSpy) - - wrapper.destroy() - }) -})