mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix tests for pagination buttons
- Now the buttons are disabled instead of remove from the DOM.
This commit is contained in:
parent
965dc48dae
commit
7fd861caa0
@ -46,18 +46,17 @@ describe('PaginationButtons.vue', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('back button', () => {
|
describe('previous button', () => {
|
||||||
it('is disabled by default', () => {
|
it('is disabled by default', () => {
|
||||||
const backButton = wrapper.find('[data-test="previous-button"]')
|
const previousButton = wrapper.find('[data-test="previous-button"]')
|
||||||
expect(backButton.attributes().disabled).toEqual('disabled')
|
expect(previousButton.attributes().disabled).toEqual('disabled')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('is enabled if hasPrevious is true', async () => {
|
it('is enabled if hasPrevious is true', async () => {
|
||||||
wrapper.setProps({ hasPrevious: true })
|
wrapper.setProps({ hasPrevious: true })
|
||||||
await wrapper.vm.$nextTick()
|
await wrapper.vm.$nextTick()
|
||||||
const backButton = wrapper.find('[data-test="previous-button"]')
|
const previousButton = wrapper.find('[data-test="previous-button"]')
|
||||||
// expect(wrapper.find('.previous-button').exists()).toEqual(true)
|
expect(previousButton.attributes().disabled).toBeUndefined()
|
||||||
expect(backButton.attributes().disabled).toBeUndefined()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('emits back when clicked', async () => {
|
it('emits back when clicked', async () => {
|
||||||
@ -79,7 +78,6 @@ describe('PaginationButtons.vue', () => {
|
|||||||
wrapper.setProps({ showPageCounter: false })
|
wrapper.setProps({ showPageCounter: false })
|
||||||
await wrapper.vm.$nextTick()
|
await wrapper.vm.$nextTick()
|
||||||
const paginationPageCount = wrapper.find('[data-test="pagination-pageCount"]')
|
const paginationPageCount = wrapper.find('[data-test="pagination-pageCount"]')
|
||||||
// expect(wrapper.find('.pagination-pageCount').exists()).toEqual(false)
|
|
||||||
expect(paginationPageCount.exists()).toEqual(false)
|
expect(paginationPageCount.exists()).toEqual(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user