From 1bd57dfeb891a6ed64ffddfa1c5a39a454bb6c3a Mon Sep 17 00:00:00 2001 From: roschaefer Date: Fri, 6 Sep 2019 16:42:16 +0200 Subject: [PATCH] Fix console.errors in test --- webapp/components/CommentList/CommentList.spec.js | 1 + .../components/ContributionForm/ContributionForm.spec.js | 1 + webapp/components/FilterPosts/FilterPosts.spec.js | 1 + webapp/components/PostCard/index.spec.js | 9 ++------- .../NotificationList/NotificationList.spec.js | 1 + webapp/pages/profile/_id/_slug.spec.js | 1 + 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/webapp/components/CommentList/CommentList.spec.js b/webapp/components/CommentList/CommentList.spec.js index 0fa1e8b81..80cf6aab1 100644 --- a/webapp/components/CommentList/CommentList.spec.js +++ b/webapp/components/CommentList/CommentList.spec.js @@ -34,6 +34,7 @@ describe('CommentList.vue', () => { } store = new Vuex.Store({ getters: { + 'auth/isModerator': () => false, 'auth/user': () => { return {} }, diff --git a/webapp/components/ContributionForm/ContributionForm.spec.js b/webapp/components/ContributionForm/ContributionForm.spec.js index 90ed226ee..eaba26360 100644 --- a/webapp/components/ContributionForm/ContributionForm.spec.js +++ b/webapp/components/ContributionForm/ContributionForm.spec.js @@ -86,6 +86,7 @@ describe('ContributionForm.vue', () => { 'editor/placeholder': () => { return 'some cool placeholder' }, + 'auth/isModerator': () => false, 'auth/user': () => { return { id: '4711', diff --git a/webapp/components/FilterPosts/FilterPosts.spec.js b/webapp/components/FilterPosts/FilterPosts.spec.js index 8d04619e1..509ff32b7 100644 --- a/webapp/components/FilterPosts/FilterPosts.spec.js +++ b/webapp/components/FilterPosts/FilterPosts.spec.js @@ -55,6 +55,7 @@ describe('FilterPosts.vue', () => { } getters = { 'postsFilter/isActive': () => false, + 'auth/isModerator': () => false, 'auth/user': () => { return { id: 'u34' } }, diff --git a/webapp/components/PostCard/index.spec.js b/webapp/components/PostCard/index.spec.js index d77e5346c..26d0515d6 100644 --- a/webapp/components/PostCard/index.spec.js +++ b/webapp/components/PostCard/index.spec.js @@ -33,13 +33,6 @@ describe('PostCard', () => { disabled: false, }, } - store = new Vuex.Store({ - getters: { - 'auth/user': () => { - return {} - }, - }, - }) stubs = { NuxtLink: RouterLinkStub, } @@ -56,6 +49,7 @@ describe('PostCard', () => { }, } getters = { + 'auth/isModerator': () => false, 'auth/user': () => { return {} }, @@ -64,6 +58,7 @@ describe('PostCard', () => { describe('shallowMount', () => { Wrapper = () => { + store = new Vuex.Store({ getters }) return shallowMount(PostCard, { store, propsData, diff --git a/webapp/components/notifications/NotificationList/NotificationList.spec.js b/webapp/components/notifications/NotificationList/NotificationList.spec.js index 82d3f5d62..c8e95e067 100644 --- a/webapp/components/notifications/NotificationList/NotificationList.spec.js +++ b/webapp/components/notifications/NotificationList/NotificationList.spec.js @@ -26,6 +26,7 @@ describe('NotificationList.vue', () => { beforeEach(() => { store = new Vuex.Store({ getters: { + 'auth/isModerator': () => false, 'auth/user': () => { return {} }, diff --git a/webapp/pages/profile/_id/_slug.spec.js b/webapp/pages/profile/_id/_slug.spec.js index 60b7ea4c7..6470bb69a 100644 --- a/webapp/pages/profile/_id/_slug.spec.js +++ b/webapp/pages/profile/_id/_slug.spec.js @@ -68,6 +68,7 @@ describe('ProfileSlug', () => { } mocks.$store = { getters: { + 'auth/isModerator': () => false, 'auth/user': { id: 'u23', },