Skip to content

Commit

Permalink
Export decorators properly in preview.tsx
Browse files Browse the repository at this point in the history
jandrade committed Nov 28, 2024
1 parent 6ad522e commit 93279fa
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -115,11 +115,9 @@ const withThemeSwitcher: Decorator = (
);
};

export const decorators = [withThemeSwitcher];

const preview: Preview = {
parameters,

decorators: [withThemeSwitcher],
globalTypes: {
// Allow the user to select a theme from the toolbar.
theme: {
11 changes: 5 additions & 6 deletions __docs__/wonder-blocks-dropdown/combobox.stories.tsx
Original file line number Diff line number Diff line change
@@ -325,15 +325,14 @@ export const ControlledMultilpleCombobox: Story = {
value: ["pear", "grape"],
selectionType: "multiple",
},
// decorators: [
// (Story): React.ReactElement<React.ComponentProps<typeof View>> => (
// <View style={styles.wrapper}>{Story()}</View>
// ),
// ],
decorators: [
(Story): React.ReactElement<React.ComponentProps<typeof View>> => (
<View style={styles.wrapper}>{Story()}</View>
),
],

play: async ({canvasElement}) => {
const canvas = within(canvasElement.ownerDocument.body);
console.log("combobox.play.canvasElement: ", canvasElement);

// Move to second option item
await userEvent.keyboard("{ArrowDown}");
1 change: 0 additions & 1 deletion __docs__/wonder-blocks-switch/switch.stories.tsx
Original file line number Diff line number Diff line change
@@ -103,7 +103,6 @@ export const Controlled: StoryComponentType = {
},
play: async ({canvasElement}) => {
const canvas = within(canvasElement);
console.log("switch.play.canvas: ", canvas);

const switchWithIcon = canvas.getByTestId("test-switch");
const switchInput = canvas.getByRole("switch", {name: "test switch"});

0 comments on commit 93279fa

Please sign in to comment.