Fix frontend tests

This commit is contained in:
roschaefer 2019-08-30 01:35:05 +02:00
parent c585b23d7a
commit f635b0cbd5
2 changed files with 12 additions and 12 deletions

View File

@ -38,8 +38,8 @@ describe('Notification', () => {
beforeEach(() => {
propsData.notification = {
reason: 'comment_on_post',
post: null,
comment: {
from: {
__typename: 'Comment',
id: 'comment-1',
contentExcerpt:
'<a href="/profile/u123" target="_blank">@dagobert-duck</a> is the best on this comment.',
@ -92,14 +92,14 @@ describe('Notification', () => {
beforeEach(() => {
propsData.notification = {
reason: 'mentioned_in_post',
post: {
from: {
__typename: 'Post',
title: "It's a post title",
id: 'post-1',
slug: 'its-a-title',
contentExcerpt:
'<a href="/profile/u3" target="_blank">@jenny-rostock</a> is the best on this post.',
},
comment: null,
}
})
@ -138,8 +138,8 @@ describe('Notification', () => {
beforeEach(() => {
propsData.notification = {
reason: 'mentioned_in_comment',
post: null,
comment: {
from: {
__typename: 'Comment',
id: 'comment-1',
contentExcerpt:
'<a href="/profile/u123" target="_blank">@dagobert-duck</a> is the best on this comment.',

View File

@ -40,9 +40,9 @@ describe('NotificationList.vue', () => {
propsData = {
notifications: [
{
id: 'notification-41',
read: false,
post: {
from: {
__typename: 'Post',
id: 'post-1',
title: 'some post title',
slug: 'some-post-title',
@ -55,9 +55,9 @@ describe('NotificationList.vue', () => {
},
},
{
id: 'notification-42',
read: false,
post: {
from: {
__typename: 'Post',
id: 'post-2',
title: 'another post title',
slug: 'another-post-title',
@ -115,9 +115,9 @@ describe('NotificationList.vue', () => {
.trigger('click')
})
it("emits 'markAsRead' with the notificationId", () => {
it("emits 'markAsRead' with the id of the notification source", () => {
expect(wrapper.emitted('markAsRead')).toBeTruthy()
expect(wrapper.emitted('markAsRead')[0]).toEqual(['notification-42'])
expect(wrapper.emitted('markAsRead')[0]).toEqual(['post-2'])
})
})
})