about summary refs log tree commit diff
path: root/components/Posts/PostList/PurePostList.stories.js
blob: a159982047f517f6a1595d57af527315fd463e88 (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 = { ...postLink }
delete postLinkNoImage['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: [] }),
    }
  })