mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix tests for changed implementation
- we do not display a load more button when there are clearly no more posts to load... if there are at least 6, the pageSize, we display it because there might or might not be posts to load
This commit is contained in:
parent
c9219f0be3
commit
fd388fc1ba
@ -139,7 +139,23 @@ describe('ProfileSlug', () => {
|
||||
wrapper.setData({ posts, hasMore: true })
|
||||
})
|
||||
|
||||
it('displays a "load more" button', () => {
|
||||
it('does not display a "load more" button', () => {
|
||||
expect(wrapper.find('.load-more').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('pagination returned at least as many posts as pageSize', () => {
|
||||
beforeEach(() => {
|
||||
const posts = [1, 2, 3, 4, 5, 6].map(id => {
|
||||
return {
|
||||
...aPost,
|
||||
id,
|
||||
}
|
||||
})
|
||||
wrapper.setData({ posts })
|
||||
})
|
||||
|
||||
it('displays "load more" button', () => {
|
||||
expect(wrapper.find('.load-more').exists()).toBe(true)
|
||||
})
|
||||
|
||||
@ -157,23 +173,6 @@ describe('ProfileSlug', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('pagination returned as many posts as available', () => {
|
||||
beforeEach(() => {
|
||||
const posts = [1, 2, 3, 4, 5, 6].map(id => {
|
||||
return {
|
||||
...aPost,
|
||||
id,
|
||||
}
|
||||
})
|
||||
|
||||
wrapper.setData({ posts, hasMore: false })
|
||||
})
|
||||
|
||||
it('displays no "load more" button', () => {
|
||||
expect(wrapper.find('.load-more').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user