This describes how to use storybook stories as fixtures in jest, and how to mock action to test behavior in the story.
Link to full example: https://github.com/lifeiscontent/realworld
| import json from "../routes.json"; | |
| type RouteNode = { | |
| id: string; | |
| path?: string; | |
| file: string; | |
| index?: boolean; | |
| children?: RouteNode[]; | |
| }; |
| { | |
| "remoteUser" : "${localEnv:USER}", | |
| "remoteEnv" : { | |
| "COLORTERM" : "${localEnv:COLORTERM}", | |
| "DBUS_SESSION_BUS_ADDRESS" : "${localEnv:DBUS_SESSION_BUS_ADDRESS}", | |
| "DESKTOP_SESSION" : "${localEnv:DESKTOP_SESSION}", | |
| "DISPLAY" : "${localEnv:DISPLAY}", | |
| "LANG" : "${localEnv:LANG}", | |
| "SHELL" : "${localEnv:SHELL}", | |
| "SSH_AUTH_SOCK" : "${localEnv:SSH_AUTH_SOCK}", |
| const callAll = <Args extends readonly unknown[]>( | |
| ...fns: readonly (((...args: Args) => void) | undefined)[] | |
| ) => (...args: Args): void => fns.forEach((fn) => fn?.(...args)); | |
| export default callAll; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
This describes how to use storybook stories as fixtures in jest, and how to mock action to test behavior in the story.
Link to full example: https://github.com/lifeiscontent/realworld
| console.log('hello world'); |