mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
fix lint errors
This commit is contained in:
@@ -17,7 +17,7 @@ describe('DbUploader.vue', () => {
|
||||
saveSchema: sinon.stub()
|
||||
}
|
||||
const store = new Vuex.Store({ state, mutations })
|
||||
|
||||
|
||||
// mock getting a file from user
|
||||
const file = {}
|
||||
sinon.stub(fu, 'getFileFromUser').resolves(file)
|
||||
@@ -72,7 +72,7 @@ describe('DbUploader.vue', () => {
|
||||
value: [file],
|
||||
writable: false
|
||||
})
|
||||
|
||||
|
||||
await wrapper.find('.drop-area').trigger('drop', dropData)
|
||||
expect($db.loadDb.calledOnceWith(file)).to.equal(true)
|
||||
await $db.loadDb.returnValues[0]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { expect } from 'chai'
|
||||
import sinon from 'sinon'
|
||||
import { mount, shallowMount } from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Pager from '@/components/Pager.vue'
|
||||
|
||||
describe('Pager.vue', () => {
|
||||
@@ -9,11 +9,13 @@ describe('Pager.vue', () => {
|
||||
})
|
||||
|
||||
it('emits input event with a page', async () => {
|
||||
const wrapper = mount(Pager, { propsData: {
|
||||
pageCount: 5
|
||||
}})
|
||||
const wrapper = mount(Pager, {
|
||||
propsData: {
|
||||
pageCount: 5
|
||||
}
|
||||
})
|
||||
|
||||
// click on 'next page' link
|
||||
// click on 'next page' link
|
||||
await wrapper.find('.paginator-next').trigger('click')
|
||||
expect(wrapper.emitted('input')[0]).to.eql([2])
|
||||
|
||||
@@ -23,9 +25,11 @@ describe('Pager.vue', () => {
|
||||
})
|
||||
|
||||
it('changes the page when value is changed', async () => {
|
||||
const wrapper = mount(Pager, { propsData: {
|
||||
pageCount: 5
|
||||
}})
|
||||
const wrapper = mount(Pager, {
|
||||
propsData: {
|
||||
pageCount: 5
|
||||
}
|
||||
})
|
||||
|
||||
await wrapper.setProps({ value: 5 })
|
||||
expect(wrapper.emitted('input')[0]).to.eql([5])
|
||||
|
||||
@@ -15,8 +15,7 @@ describe('Splitpanes.vue', () => {
|
||||
after: { size: 40, max: 100 }
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
expect(wrapper.findAll('.splitpanes-pane')).to.have.lengthOf(2)
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(0).element.style.width).to.equal('60%')
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(1).element.style.width).to.equal('40%')
|
||||
@@ -35,8 +34,7 @@ describe('Splitpanes.vue', () => {
|
||||
horizontal: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
expect(wrapper.findAll('.splitpanes-pane')).to.have.lengthOf(2)
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(0).element.style.height).to.equal('60%')
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(1).element.style.height).to.equal('40%')
|
||||
@@ -54,7 +52,7 @@ describe('Splitpanes.vue', () => {
|
||||
after: { size: 40, max: 100 }
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
await wrapper.find('.toggle-btn').trigger('click')
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(0).element.style.width).to.equal('0%')
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(1).element.style.width).to.equal('100%')
|
||||
@@ -79,7 +77,7 @@ describe('Splitpanes.vue', () => {
|
||||
root.style.height = '500px'
|
||||
root.appendChild(place)
|
||||
document.body.appendChild(root)
|
||||
|
||||
|
||||
// mount the component
|
||||
const wrapper = shallowMount(Splitpanes, {
|
||||
attachTo: place,
|
||||
@@ -92,13 +90,13 @@ describe('Splitpanes.vue', () => {
|
||||
after: { size: 40, max: 100 }
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
await wrapper.find('.splitpanes-splitter').trigger('mousedown')
|
||||
document.dispatchEvent(new MouseEvent("mousemove", {
|
||||
document.dispatchEvent(new MouseEvent('mousemove', {
|
||||
clientX: 300,
|
||||
clientY: 80
|
||||
}))
|
||||
document.dispatchEvent(new MouseEvent("mouseup"))
|
||||
document.dispatchEvent(new MouseEvent('mouseup'))
|
||||
await wrapper.vm.$nextTick()
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(0).element.style.width).to.equal('50%')
|
||||
wrapper.destroy()
|
||||
@@ -112,7 +110,7 @@ describe('Splitpanes.vue', () => {
|
||||
root.style.height = '500px'
|
||||
root.appendChild(place)
|
||||
document.body.appendChild(root)
|
||||
|
||||
|
||||
// mount the component
|
||||
const wrapper = shallowMount(Splitpanes, {
|
||||
attachTo: place,
|
||||
@@ -126,13 +124,13 @@ describe('Splitpanes.vue', () => {
|
||||
horizontal: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
await wrapper.find('.splitpanes-splitter').trigger('mousedown')
|
||||
document.dispatchEvent(new MouseEvent("mousemove", {
|
||||
document.dispatchEvent(new MouseEvent('mousemove', {
|
||||
clientX: 10,
|
||||
clientY: 250
|
||||
}))
|
||||
document.dispatchEvent(new MouseEvent("mouseup"))
|
||||
document.dispatchEvent(new MouseEvent('mouseup'))
|
||||
await wrapper.vm.$nextTick()
|
||||
expect(wrapper.findAll('.splitpanes-pane').at(0).element.style.height).to.equal('50%')
|
||||
wrapper.destroy()
|
||||
|
||||
Reference in New Issue
Block a user