Merge fixes and lint fixes

This commit is contained in:
Wolfgang Huß 2020-03-09 09:54:43 +01:00
parent af8b479fb4
commit 5dfd0f9ada
8 changed files with 18 additions and 87 deletions

View File

@ -822,7 +822,6 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
louie.relateTo(p10, 'shouted'),
])
const [
reportAgainstDagobert,
reportAgainstHuey,

View File

@ -22,7 +22,6 @@ const handleContentDataOfPost = async (resolve, root, args, context, resolveInfo
return post
}
const handleContentDataOfComment = async (resolve, root, args, context, resolveInfo) => {
const { content } = args
let idsOfUsers = extractMentionedUsers(content)

View File

@ -777,10 +777,7 @@ describe('notifications', () => {
read: false,
},
}),
).resolves.toMatchObject({
data: { notifications: [] },
errors: undefined,
})
).resolves.toEqual(expected)
})
it('does not publish `NOTIFICATION_ADDED` to authenticated user', async () => {

View File

@ -73,7 +73,7 @@ export default {
}
},
},
Mutation: {
markAsRead: async (parent, args, context, resolveInfo) => {
const { user: currentUser } = context

View File

@ -37,60 +37,6 @@ afterEach(async () => {
describe('given some notifications', () => {
beforeEach(async () => {
const categoryIds = ['cat1']
// Wolle author = await factory.create('User', { id: 'author' })
// user = await factory.create('User', { id: 'you' })
// const [neighbor, badWomen] = await Promise.all([
// factory.create('User', { id: 'neighbor' }),
// factory.create('User', { id: 'badWomen', name: 'Mrs. Badwomen' }),
// factory.create('Category', { id: 'cat1' }),
// ])
// const [post1, post2, post3, post4] = await Promise.all([
// factory.create('Post', { author, id: 'p1', categoryIds, content: 'Not for you' }),
// factory.create('Post', {
// author,
// id: 'p2',
// categoryIds,
// content: 'Already seen post mention',
// }),
// factory.create('Post', {
// author,
// id: 'p3',
// categoryIds,
// content: 'You have been mentioned in a post',
// }),
// factory.create('Post', {
// author,
// id: 'p4',
// categoryIds,
// title: 'Bad Post',
// content: 'I am bad content !!!',
// }),
// ])
// const [comment1, comment2, comment3, comment4] = await Promise.all([
// factory.create('Comment', {
// author,
// postId: 'p3',
// id: 'c1',
// content: 'You have seen this comment mentioning already',
// }),
// factory.create('Comment', {
// author,
// postId: 'p3',
// id: 'c2',
// content: 'You have been mentioned in a comment',
// }),
// factory.create('Comment', {
// author,
// postId: 'p3',
// id: 'c3',
// content: 'Somebody else was mentioned in a comment',
// }),
// factory.create('Comment', {
// author,
// postId: 'p4',
// id: 'c4',
// content: 'I am harassing content in a harassing comment to a bad post !!!',
// }),
author = await Factory.build('user', { id: 'author' })
user = await Factory.build('user', { id: 'you' })
const [neighbor, badWomen] = await Promise.all([
@ -222,15 +168,9 @@ describe('given some notifications', () => {
// report notifications
const [reportOnUser, reportOnPost, reportOnComment] = await Promise.all([
factory.create('Report', {
id: 'reportOnUser',
}),
factory.create('Report', {
id: 'reportOnPost',
}),
factory.create('Report', {
id: 'reportOnComment',
}),
Factory.build('report', { id: 'reportOnUser' }),
Factory.build('report', { id: 'reportOnPost' }),
Factory.build('report', { id: 'reportOnComment' }),
])
await Promise.all([
reportOnUser.relateTo(user, 'filed', {

View File

@ -19,7 +19,7 @@
</client-only>
<ds-space margin-bottom="x-small" />
<nuxt-link :to="notificationData.linkTo" @click.native="$emit('read')"> -->
<!-- <ds-space margin-bottom="x-small">
<!-- <ds-space margin-bottom="x-small">
<ds-card
:header="
(notificationData.isPost || notificationData.isComment) && notificationData.title
@ -85,15 +85,15 @@
)
}}
</p>
<nuxt-link
class="link"
:to="notificationData.linkTo"
@click.native="$emit('read')"
>
<nuxt-link class="link" :to="notificationData.linkTo" @click.native="$emit('read')">
<base-card wideContent>
<h2 class="title">{{ (notificationData.isPost || notificationData.isComment) && notificationData.title }}</h2>
<h2 class="title">
{{ (notificationData.isPost || notificationData.isComment) && notificationData.title }}
</h2>
<p>
<strong v-if="notificationData.isComment" class="comment">{{ $t(`notifications.comment`) }}:</strong>
<strong v-if="notificationData.isComment" class="comment">
{{ $t(`notifications.comment`) }}:
</strong>
{{ notificationData.contentExcerpt | removeHtml }}
</p>
<!-- because of different margin above ds-card content without header property -->
@ -103,19 +103,17 @@
:user="notificationData.user"
/>
<p v-else>
<strong v-if="notificationData.isComment" class="comment">{{ $t(`notifications.comment`) }}:</strong>
<strong v-if="notificationData.isComment" class="comment">
{{ $t(`notifications.comment`) }}:
</strong>
{{ notificationData.contentExcerpt | removeHtml }}
</p>
<div v-if="notificationData.isReport">
<ds-space margin-bottom="x-small" />
<strong>
{{ $t(`notifications.report.category`) }}:
</strong>
<strong>{{ $t(`notifications.report.category`) }}:</strong>
{{ $t('report.reason.category.options.' + notificationData.report.reasonCategory) }}
<br />
<strong>
{{ $t(`notifications.report.description`) }}:
</strong>
<strong>{{ $t(`notifications.report.description`) }}:</strong>
<span
v-if="
notificationData.report.reasonDescription &&

View File

@ -73,7 +73,6 @@ describe('NotificationList.vue', () => {
describe('click on a notification', () => {
beforeEach(() => {
wrapper.find('.notification .notifications-card').trigger('click')
})

View File

@ -125,4 +125,3 @@ export default {
}
}
</style>