From 34da06762e81f85c5df29fdec66e2055b8b930a9 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Tue, 3 Dec 2019 13:05:15 +0100 Subject: Add missing stories --- components/Ranking/RankingEntry.stories.js | 19 +++++++++++++++++++ components/Ranking/RankingFirstEntry.stories.js | 16 ++++++++++++++++ components/Ranking/RankingList.stories.js | 20 ++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 components/Ranking/RankingEntry.stories.js create mode 100644 components/Ranking/RankingFirstEntry.stories.js create mode 100644 components/Ranking/RankingList.stories.js (limited to 'components/Ranking') diff --git a/components/Ranking/RankingEntry.stories.js b/components/Ranking/RankingEntry.stories.js new file mode 100644 index 0000000..20bf6e1 --- /dev/null +++ b/components/Ranking/RankingEntry.stories.js @@ -0,0 +1,19 @@ +import { storiesOf } from '@storybook/vue' +import { center } from '../../.storybook/decorators' + +import RankingEntry from './RankingEntry' + +export const rankingEntry = { + troop: 'Test', + points: 32 +} + +storiesOf('Ranking/RankingEntry', module) + .addDecorator(center) + .add('default', () => { + return { + components: { RankingEntry }, + template: ``, + data: () => rankingEntry + } + }) diff --git a/components/Ranking/RankingFirstEntry.stories.js b/components/Ranking/RankingFirstEntry.stories.js new file mode 100644 index 0000000..05fa517 --- /dev/null +++ b/components/Ranking/RankingFirstEntry.stories.js @@ -0,0 +1,16 @@ +import { storiesOf } from '@storybook/vue' +import { center } from '../../.storybook/decorators' + +import RankingFirstEntry from './RankingFirstEntry' + +import { rankingEntry } from './RankingEntry.stories' + +storiesOf('Ranking/RankingFirstEntry', module) + .addDecorator(center) + .add('default', () => { + return { + components: { RankingFirstEntry }, + template: ``, + data: () => rankingEntry + } + }) diff --git a/components/Ranking/RankingList.stories.js b/components/Ranking/RankingList.stories.js new file mode 100644 index 0000000..c7b287d --- /dev/null +++ b/components/Ranking/RankingList.stories.js @@ -0,0 +1,20 @@ +import { storiesOf } from '@storybook/vue' +import { center } from '../../.storybook/decorators' + +import RankingList from './RankingList' + +import { rankingEntry } from './RankingEntry.stories' + +const rankingList = { + scores: Array(3).fill(rankingEntry) +} + +storiesOf('Ranking/RankingList', module) + .addDecorator(center) + .add('default', () => { + return { + components: { RankingList }, + template: ``, + data: () => rankingList + } + }) -- cgit 1.4.1 From a8db3a02693e14dccd98f401e5ae78f6e5822b57 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Tue, 3 Dec 2019 16:47:20 +0100 Subject: Fix keys of RankingList story --- components/Ranking/RankingList.stories.js | 10 +- tests/unit/__snapshots__/storybook.test.js.snap | 589 +++++++++++++++++++++++- 2 files changed, 585 insertions(+), 14 deletions(-) (limited to 'components/Ranking') diff --git a/components/Ranking/RankingList.stories.js b/components/Ranking/RankingList.stories.js index c7b287d..830dd6a 100644 --- a/components/Ranking/RankingList.stories.js +++ b/components/Ranking/RankingList.stories.js @@ -6,7 +6,10 @@ import RankingList from './RankingList' import { rankingEntry } from './RankingEntry.stories' const rankingList = { - scores: Array(3).fill(rankingEntry) + scores: Array.from(Array(3).keys()).map(i => ({ + ...rankingEntry, + troop: `Troop${i}` + })) } storiesOf('Ranking/RankingList', module) @@ -15,6 +18,9 @@ storiesOf('Ranking/RankingList', module) return { components: { RankingList }, template: ``, - data: () => rankingList + data: () => { + console.log(rankingList) + return rankingList + } } }) diff --git a/tests/unit/__snapshots__/storybook.test.js.snap b/tests/unit/__snapshots__/storybook.test.js.snap index 606044b..6bd34f6 100644 --- a/tests/unit/__snapshots__/storybook.test.js.snap +++ b/tests/unit/__snapshots__/storybook.test.js.snap @@ -1,27 +1,592 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Storyshots ChroniclePost default 1`] = ` +exports[`Storyshots Buttons/PlainButton default 1`] = `
+ +
+`; + +exports[`Storyshots Facebook/FacebookFeed default 1`] = ` +
+
+

+ Zobacz co się dzieje! +

+ + +
+ Find us on Facebook +
+
+
+
+`; + +exports[`Storyshots Facebook/FacebookFindUsButton default 1`] = ` + +`; + +exports[`Storyshots JoinUs default 1`] = ` +
+
-

- Test ChroniclePost -

+
+ Rozpocznij swoją harcerską przygodę! +
+
-

+ Dołącz do nas + +

+ + +`; + +exports[`Storyshots NavLink default 1`] = ` +
+ +
+`; + +exports[`Storyshots Posts/PostLink default 1`] = ` + +`; + +exports[`Storyshots Posts/PurePostList default 1`] = ` +
+ + +
+
+ +
+

+ Test PostLink +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar non ex non sagittis. Quisque in enim tellus. Aliquam consequat mi id sapien congue, sit amet vulputate tortor viverra. Donec.... +

+
+
+
+
+ +
+

+ Test PostLink +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar non ex non sagittis. Quisque in enim tellus. Aliquam consequat mi id sapien congue, sit amet vulputate tortor viverra. Donec.... +

+
+
+
+
+ +
+

+ Test PostLink +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar non ex non sagittis. Quisque in enim tellus. Aliquam consequat mi id sapien congue, sit amet vulputate tortor viverra. Donec.... +

+
+
+
+
+ +
+

+ Test PostLink +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar non ex non sagittis. Quisque in enim tellus. Aliquam consequat mi id sapien congue, sit amet vulputate tortor viverra. Donec.... +

+
+
+
+
+ +
+

+ Test PostLink +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar non ex non sagittis. Quisque in enim tellus. Aliquam consequat mi id sapien congue, sit amet vulputate tortor viverra. Donec.... +

+
+
+
+
+
+`; + +exports[`Storyshots Posts/PurePostList loading 1`] = ` +
+
+
+
+
+
+
+ + +
+`; + +exports[`Storyshots Posts/PurePostList no posts 1`] = ` +
+ + +
+
+`; + +exports[`Storyshots Ranking/RankingEntry default 1`] = ` +
+
  • +
    + Test +
    + +
    + 32 +
    +
  • +
    +`; + +exports[`Storyshots Ranking/RankingFirstEntry default 1`] = ` +
    +
  • + + +
    + Test +
    + +
    + 32 +
    +
  • +
    +`; + +exports[`Storyshots Ranking/RankingList default 1`] = ` +
    +
      +
    1. + + +
      + Test +
      + +
      + 32 +
      +
    2. + +
    3. +
      + Test +
      + +
      + 32 +
      +
    4. +
    5. +
      + Test +
      + +
      + 32 +
      +
    6. +
    +
    +`; + +exports[`Storyshots TheFooter default 1`] = ` +
    +
    +