about summary refs log tree commit diff
path: root/components/Posts/PostList/PurePostList.stories.js
blob: d51a5512058ca740ce3b01a4947315c3dac2d74f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { storiesOf } from '@storybook/vue'

import { postLink } from '../PostLink.stories'

import PurePostList from './PurePostList'

const postLinkNoImage = JSON.parse(JSON.stringify(postLink))
delete postLinkNoImage.meta['image']

export const posts = [
  ...Array(3).fill(postLinkNoImage),
  ...Array(5).fill(postLink),
]

storiesOf('Posts/PurePostList', module)
  .add('default', () => {
    return {
      components: { PurePostList },
      template: `<pure-post-list :posts="posts"/>`,
      data: () => ({ posts }),
    }
  })
  .add('loading', () => {
    return {
      components: { PurePostList },
      template: `<pure-post-list :posts="posts" loading/>`,
      data: () => ({ posts: [] }),
    }
  })
  .add('no posts', () => {
    return {
      components: { PurePostList },
      template: `<pure-post-list :posts="posts"/>`,
      data: () => ({ posts: [] }),
    }
  })