Skip to content

Commit

Permalink
style: linter corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
guastallaigor committed Feb 7, 2021
1 parent 755bc79 commit d1eda7c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/VueImageKit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default {
methods: {
initNormalLoad () {
const img = this.$refs.normalLoad
this.isImageLoaded = true;
this.isImageLoaded = true
this.setImgAttributes(img)
},
initLazyLoad () {
Expand Down
28 changes: 14 additions & 14 deletions tests/unit/vue-image-kit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ describe('When I create the VueImageKit component', () => {
transition: false
}
})
const observe = jest.fn();
const unobserve = jest.fn();
const disconnect = jest.fn();
const takeRecords = jest.fn();
const observe = jest.fn()
const unobserve = jest.fn()
const disconnect = jest.fn()
const takeRecords = jest.fn()
window.IntersectionObserver = jest.fn(() => ({
observe,
unobserve,
disconnect,
takeRecords,
takeRecords
}))
expect(wrapper.exists()).toBe(true)
wrapper.vm.initLazyLoad()
Expand All @@ -267,8 +267,8 @@ describe('When I create the VueImageKit component', () => {
const observerCallback = window.IntersectionObserver.mock.calls[0][0]
const mockEntry = { isIntersecting: true }
observerCallback([mockEntry])
expect(wrapper.vm.observer.observe).toHaveBeenCalled();
expect(wrapper.vm.triggerIntersection).toHaveBeenCalledTimes(1);
expect(wrapper.vm.observer.observe).toHaveBeenCalled()
expect(wrapper.vm.triggerIntersection).toHaveBeenCalledTimes(1)
})

it('should not trigger intersection', () => {
Expand All @@ -280,15 +280,15 @@ describe('When I create the VueImageKit component', () => {
transition: false
}
})
const observe = jest.fn();
const unobserve = jest.fn();
const disconnect = jest.fn();
const takeRecords = jest.fn();
const observe = jest.fn()
const unobserve = jest.fn()
const disconnect = jest.fn()
const takeRecords = jest.fn()
window.IntersectionObserver = jest.fn(() => ({
observe,
unobserve,
disconnect,
takeRecords,
takeRecords
}))
expect(wrapper.exists()).toBe(true)
wrapper.vm.initLazyLoad()
Expand All @@ -299,8 +299,8 @@ describe('When I create the VueImageKit component', () => {
const observerCallback = window.IntersectionObserver.mock.calls[0][0]
const mockEntry = { isIntersecting: false }
observerCallback([mockEntry])
expect(wrapper.vm.setImgAttributes).not.toHaveBeenCalled();
expect(wrapper.vm.observer.disconnect).not.toHaveBeenCalled();
expect(wrapper.vm.setImgAttributes).not.toHaveBeenCalled()
expect(wrapper.vm.observer.disconnect).not.toHaveBeenCalled()
})

it('should match snapshot', () => {
Expand Down

0 comments on commit d1eda7c

Please sign in to comment.