From 950df1cd0723b7faaaab5c4ec6141731034ffb43 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Fri, 15 Nov 2019 15:45:05 +0100 Subject: [PATCH] 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. --- webapp/pages/index.spec.js | 3 +-- webapp/pages/profile/_id/_slug.spec.js | 18 +----------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/webapp/pages/index.spec.js b/webapp/pages/index.spec.js index 68c4e3314..73e88d972 100644 --- a/webapp/pages/index.spec.js +++ b/webapp/pages/index.spec.js @@ -18,6 +18,7 @@ localVue.use(InfiniteLoading) config.stubs['client-only'] = '' config.stubs['router-link'] = '' config.stubs['nuxt-link'] = '' +config.stubs['infinite-loading'] = '' 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, }) diff --git a/webapp/pages/profile/_id/_slug.spec.js b/webapp/pages/profile/_id/_slug.spec.js index fbf94d300..4dfbbd3e0 100644 --- a/webapp/pages/profile/_id/_slug.spec.js +++ b/webapp/pages/profile/_id/_slug.spec.js @@ -16,6 +16,7 @@ localVue.filter('date', d => d) config.stubs['client-only'] = '' config.stubs['v-popover'] = '' config.stubs['nuxt-link'] = '' +config.stubs['infinite-loading'] = '' 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 => {