From f635b0cbd5a29a37d405217704c4215990345019 Mon Sep 17 00:00:00 2001 From: roschaefer Date: Fri, 30 Aug 2019 01:35:05 +0200 Subject: [PATCH] Fix frontend tests --- .../notifications/Notification/Notification.spec.js | 12 ++++++------ .../NotificationList/NotificationList.spec.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/webapp/components/notifications/Notification/Notification.spec.js b/webapp/components/notifications/Notification/Notification.spec.js index 279500f7f..6ba38e53a 100644 --- a/webapp/components/notifications/Notification/Notification.spec.js +++ b/webapp/components/notifications/Notification/Notification.spec.js @@ -38,8 +38,8 @@ describe('Notification', () => { beforeEach(() => { propsData.notification = { reason: 'comment_on_post', - post: null, - comment: { + from: { + __typename: 'Comment', id: 'comment-1', contentExcerpt: '@dagobert-duck 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: '@jenny-rostock 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: '@dagobert-duck is the best on this comment.', diff --git a/webapp/components/notifications/NotificationList/NotificationList.spec.js b/webapp/components/notifications/NotificationList/NotificationList.spec.js index 4972c09a1..82d3f5d62 100644 --- a/webapp/components/notifications/NotificationList/NotificationList.spec.js +++ b/webapp/components/notifications/NotificationList/NotificationList.spec.js @@ -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']) }) }) })