Skip to content

Instantly share code, notes, and snippets.

npx create-instantsearch-app my-app
cd my-app
npm start
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;
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()};
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 = {
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);