mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix frontend tests
I also removed one frontend test. The test case was checking an edge case. We use `hasMore` as the single source of truth so I think it's safe to remove this test case.
This commit is contained in:
parent
3fa7eeb038
commit
950df1cd07
@ -18,6 +18,7 @@ localVue.use(InfiniteLoading)
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['router-link'] = '<span><slot /></span>'
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
config.stubs['infinite-loading'] = '<span><slot /></span>'
|
||||
|
||||
describe('PostIndex', () => {
|
||||
let wrapper
|
||||
@ -29,7 +30,6 @@ describe('PostIndex', () => {
|
||||
beforeEach(() => {
|
||||
mutations = {
|
||||
'posts/SELECT_ORDER': jest.fn(),
|
||||
'posts/SET_CURRENT_POSTS': jest.fn(),
|
||||
}
|
||||
store = new Vuex.Store({
|
||||
getters: {
|
||||
@ -54,7 +54,6 @@ describe('PostIndex', () => {
|
||||
'auth/user': () => {
|
||||
return { id: 'u23' }
|
||||
},
|
||||
'posts/currentPosts': () => [],
|
||||
},
|
||||
mutations,
|
||||
})
|
||||
|
||||
@ -16,6 +16,7 @@ localVue.filter('date', d => d)
|
||||
config.stubs['client-only'] = '<span><slot /></span>'
|
||||
config.stubs['v-popover'] = '<span><slot /></span>'
|
||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||
config.stubs['infinite-loading'] = '<span><slot /></span>'
|
||||
|
||||
describe('ProfileSlug', () => {
|
||||
let wrapper
|
||||
@ -127,23 +128,6 @@ describe('ProfileSlug', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('pagination returned less posts than available', () => {
|
||||
beforeEach(() => {
|
||||
const posts = [1, 2, 3, 4, 5].map(id => {
|
||||
return {
|
||||
...aPost,
|
||||
id,
|
||||
}
|
||||
})
|
||||
|
||||
wrapper.setData({ posts, hasMore: true })
|
||||
})
|
||||
|
||||
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 => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user