From db7908139cf807486b04e204fc05dddaa0823879 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?=
Date: Wed, 8 Apr 2020 15:56:27 +0200
Subject: [PATCH] Cleanup
---
backend/src/middleware/validation/validationMiddleware.js | 6 +++---
webapp/components/Notification/Notification.spec.js | 8 ++++----
webapp/components/Notification/Notification.vue | 4 ++--
.../NotificationsTable/NotificationsTable.spec.js | 8 ++++----
.../components/NotificationsTable/NotificationsTable.vue | 4 ++--
webapp/components/utils/Notifications.js | 2 +-
webapp/locales/de.json | 4 ++--
webapp/locales/en.json | 4 ++--
8 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/backend/src/middleware/validation/validationMiddleware.js b/backend/src/middleware/validation/validationMiddleware.js
index d36e64846..e98a787a2 100644
--- a/backend/src/middleware/validation/validationMiddleware.js
+++ b/backend/src/middleware/validation/validationMiddleware.js
@@ -60,10 +60,10 @@ const validateUpdatePost = async (resolve, root, args, context, info) => {
return validatePost(resolve, root, args, context, info)
}
-const validateReport = async (resolve, root, args, context, info) => {
+const validateFiledReport = async (resolve, root, args, context, info) => {
const { resourceId } = args
const { user } = context
- if (resourceId === user.id) throw new Error('You cannot report yourself!')
+ if (resourceId === user.id) throw new Error("You can't file a report about yourself!")
return resolve(root, args, context, info)
}
@@ -141,7 +141,7 @@ export default {
CreatePost: validatePost,
UpdatePost: validateUpdatePost,
UpdateUser: validateUpdateUser,
- fileReport: validateReport,
+ fileReport: validateFiledReport,
review: validateReview,
},
}
diff --git a/webapp/components/Notification/Notification.spec.js b/webapp/components/Notification/Notification.spec.js
index 6986db47d..ff3da9d35 100644
--- a/webapp/components/Notification/Notification.spec.js
+++ b/webapp/components/Notification/Notification.spec.js
@@ -236,14 +236,14 @@ describe('Notification', () => {
expect(wrapper.text()).toContain('@mrs.-badwomen')
})
- it('renders the identifier "notifications.report.category"', () => {
+ it('renders the identifier "notifications.filedReport.category"', () => {
wrapper = Wrapper()
- expect(wrapper.text()).toContain('notifications.report.category')
+ expect(wrapper.text()).toContain('notifications.filedReport.category')
})
- it('renders the identifier "notifications.report.description"', () => {
+ it('renders the identifier "notifications.filedReport.description"', () => {
wrapper = Wrapper()
- expect(wrapper.text()).toContain('notifications.report.description')
+ expect(wrapper.text()).toContain('notifications.filedReport.description')
})
it('has no class "read"', () => {
diff --git a/webapp/components/Notification/Notification.vue b/webapp/components/Notification/Notification.vue
index bae604a09..a747e7b0a 100644
--- a/webapp/components/Notification/Notification.vue
+++ b/webapp/components/Notification/Notification.vue
@@ -29,10 +29,10 @@
-
{{ $t(`notifications.report.category`) }}:
+
{{ $t(`notifications.filedReport.category`) }}:
{{ $t('report.reason.category.options.' + notificationData.filedReport.reasonCategory) }}
-
{{ $t(`notifications.report.description`) }}:
+
{{ $t(`notifications.filedReport.description`) }}:
{
+ it('renders the identifier "notifications.filedReport.category"', () => {
wrapper = Wrapper()
- expect(wrapper.text()).toContain('notifications.report.category')
+ expect(wrapper.text()).toContain('notifications.filedReport.category')
})
it('renders the reported category', () => {
@@ -190,9 +190,9 @@ describe('NotificationsTable.vue', () => {
)
})
- it('renders the identifier "notifications.report.description"', () => {
+ it('renders the identifier "notifications.filedReport.description"', () => {
wrapper = Wrapper()
- expect(wrapper.text()).toContain('notifications.report.description')
+ expect(wrapper.text()).toContain('notifications.filedReport.description')
})
it('renders the reported description', () => {
diff --git a/webapp/components/NotificationsTable/NotificationsTable.vue b/webapp/components/NotificationsTable/NotificationsTable.vue
index 0f1591702..946d343e8 100644
--- a/webapp/components/NotificationsTable/NotificationsTable.vue
+++ b/webapp/components/NotificationsTable/NotificationsTable.vue
@@ -46,12 +46,12 @@
{{ $t('report.reason.category.options.' + scope.row.filedReport.reasonCategory) }}