mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix frontend tests
This commit is contained in:
parent
c585b23d7a
commit
f635b0cbd5
@ -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.',
|
||||
|
||||
@ -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'])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user