This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx create-instantsearch-app my-app | |
cd my-app | |
npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {storiesOf as storiesOfReal, | |
action as actionReal, | |
linkTo as linkToReal} from "@kadira/storybook" | |
export const storiesOf = storiesOfReal; | |
export const action = actionReal; | |
export const linkTo = linkToReal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const storiesOf = function storiesOf() { | |
var api = {}; | |
api.add = ()=> { return api; }; | |
api.addWithInfo = ()=> { return api; }; | |
return api; | |
}; | |
export const action = () => {return expect.createSpy()}; | |
export const linkTo = () => {return expect.createSpy()}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const TWO_TODO_ITEMS_WITH_ONE_COMPLETED = getMainSection([ | |
{ id: 'one', text: 'Item One', completed: false }, | |
{ id: 'two', text: 'Item Two', completed: true }, | |
]); | |
storiesOf('MainSection', module) | |
.add('some completed', () => TWO_TODO_ITEMS_WITH_ONE_COMPLETED); | |
function getMainSection(todos) { | |
const actions = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
storiesOf('MainSection', module) | |
.add('some completed', () => { | |
const story = getMainSection([ | |
{ id: 'one', text: 'Item One', completed: false }, | |
{ id: 'two', text: 'Item Two', completed: true }, | |
]); | |
specs(() => describe('some completed', function () { | |
it('Should indicate that only one item is left', function () { | |
let output = mount(story); |