Add example notification for filed report to storybook

This commit is contained in:
Wolfgang Huß 2020-01-22 13:32:54 +01:00
parent e563887022
commit 0bb2b905ee
4 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@ import NotificationList from './NotificationList'
import Notification from '../Notification/Notification'
import Vuex from 'vuex'
import { notifications } from '~/components/utils/Notifications'
import { testNotifications } from '~/components/utils/Notifications'
const localVue = global.localVue
@ -34,7 +34,7 @@ describe('NotificationList.vue', () => {
stubs = {
NuxtLink: RouterLinkStub,
}
propsData = { notifications }
propsData = { notifications: testNotifications }
})
describe('shallowMount', () => {

View File

@ -3,7 +3,7 @@ import { config, mount, RouterLinkStub } from '@vue/test-utils'
import Vuex from 'vuex'
import NotificationsTable from './NotificationsTable'
import { notifications } from '~/components/utils/Notifications'
import { testNotifications } from '~/components/utils/Notifications'
const localVue = global.localVue
localVue.filter('truncate', string => string)
@ -12,6 +12,7 @@ config.stubs['client-only'] = '<span><slot /></span>'
describe('NotificationsTable.vue', () => {
let wrapper, mocks, propsData, stubs
const notifications = testNotifications
const postNotification = notifications[0]
const commentNotification = notifications[1]
const reportNotification = notifications[2]

View File

@ -1,6 +1,7 @@
import { storiesOf } from '@storybook/vue'
import { withA11y } from '@storybook/addon-a11y'
import { action } from '@storybook/addon-actions'
import { testNotifications } from '~/components/utils/Notifications'
import NotificationsTable from '~/components/NotificationsTable/NotificationsTable'
import helpers from '~/storybook/helpers'
import { post } from '~/components/PostCard/PostCard.story.js'
@ -61,6 +62,7 @@ export const notifications = [
__typename: 'NOTIFIED',
index: 2,
},
...testNotifications,
]
storiesOf('NotificationsTable', module)
.addDecorator(withA11y)

View File

@ -1,4 +1,4 @@
export const notifications = [
export const testNotifications = [
{
read: false,
reason: 'mentioned_in_post',