Skip to content

Commit ad8baeb

Browse files
committed
Set up ToggleSwitch.stories.tsx that launches successfully from a hardcoded fake.js
1 parent eb6290a commit ad8baeb

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
stories: ['../lib/**/*.stories.js'],
3+
addons: ['@storybook/addon-links', '@storybook/addon-essentials']
4+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const parameters = {
2+
actions: { argTypesRegex: '^on[A-Z].*' },
3+
controls: {
4+
matchers: {
5+
color: /(background|color)$/i,
6+
date: /Date$/
7+
}
8+
}
9+
};

build-tests-samples/heft-storybook-react-tutorial/.vscode/launch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Debug fake.js",
11+
"program": "${workspaceFolder}/fake.js",
12+
"args": [ "-p", "6006"],
13+
"cwd": "${workspaceFolder}",
14+
"console": "integratedTerminal",
15+
"sourceMaps": false
16+
},
717
{
818
"type": "node",
919
"request": "launch",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const enginePath =
2+
'C:\\Git\\rushstack\\build-tests-samples\\heft-storybook-react-tutorial\\node_modules\\heft-storybook-react-tutorial-storybook\\node_modules\\@storybook\\react\\dist\\cjs\\server\\index.js';
3+
debugger;
4+
require(enginePath);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as React from 'react';
2+
import { ComponentStory, ComponentMeta } from '@storybook/react';
3+
4+
import { ToggleSwitch } from './ToggleSwitch';
5+
6+
export default {
7+
title: 'Octogonz/ToggleSwitch',
8+
component: ToggleSwitch,
9+
argTypes: {
10+
leftColor: { control: 'color' },
11+
rightColor: { control: 'color' }
12+
}
13+
} as ComponentMeta<typeof ToggleSwitch>;
14+
15+
const Template: ComponentStory<typeof ToggleSwitch> = (args) => <ToggleSwitch {...args} />;
16+
17+
// eslint-disable-next-line
18+
export const Primary: any = Template.bind({});
19+
Primary.args = {};
20+
21+
// eslint-disable-next-line
22+
export const Secondary: any = Template.bind({});
23+
Secondary.args = {};

0 commit comments

Comments
 (0)