1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2026-03-24 15:06:17 +08:00

change repo structure

This commit is contained in:
lana-k
2026-01-15 21:53:12 +01:00
parent 85b5a200e2
commit 7edc196a02
64 changed files with 74 additions and 74 deletions

View File

@@ -0,0 +1,27 @@
import { expect } from 'chai'
import sinon from 'sinon'
import { mount } from '@vue/test-utils'
import Pager from '@/components/Common/Pager'
describe('Pager.vue', () => {
afterEach(() => {
sinon.restore()
})
it('emits update:modelValue event with a page', async () => {
const wrapper = mount(Pager, {
props: {
pageCount: 5,
'onUpdate:modelValue': e => wrapper.setProps({ modelValue: e })
}
})
// click on 'next page' link
await wrapper.find('.paginator-next').trigger('click')
expect(wrapper.props('modelValue')).to.eql(2)
// click on the link to page 3 (it has index 2)
await wrapper.findAll('.paginator-page-link')[2].trigger('click')
expect(wrapper.props('modelValue')).to.eql(3)
})
})