Skip to content

Commit

Permalink
Merge pull request #1 from idesigncode/updates
Browse files Browse the repository at this point in the history
Updates: Storybook dependencies
  • Loading branch information
idesigncode authored Jul 28, 2023
2 parents 6b92ede + 2e0a73e commit 94985ec
Show file tree
Hide file tree
Showing 40 changed files with 68 additions and 107 deletions.
14 changes: 1 addition & 13 deletions .storybook/main.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import packageJson from '../package.json';
import { webpackFinal } from '@idesigncode/storybook-tools/storybookConfig.mjs';
import webpackFinal from '@idesigncode/storybook-tools/webpackFinal.cjs';

export default {
addons: [
Expand Down Expand Up @@ -32,17 +32,5 @@ export default {
options: {},
},
stories: ['../**/RequiredProps.mdx', '../**/*.mdx', '../**/*.stories.*'],
storyIndexers: (indexers) => {
// Extend js story indexer for mjs
return indexers.map((indexer) => {
if (`${indexer.test}`.includes(`[tj]sx?$`)) {
return {
...indexer,
test: /(stories|story)\.m?[tj]sx?$/,
};
}
return indexer;
});
},
webpackFinal,
};
4 changes: 0 additions & 4 deletions __snapshots__/props-as.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,6 @@ exports[`Props/as As Component Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down Expand Up @@ -1070,8 +1068,6 @@ exports[`Props/as As Tag Name Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-children.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,6 @@ exports[`Props/children Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-classname.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,6 @@ exports[`Props/className Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-disabled.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ exports[`Props/disabled Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-displayformat.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ exports[`Props/displayFormat Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-format.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ exports[`Props/format Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-html-attributes.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ exports[`Props/HTML attributes Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
12 changes: 5 additions & 7 deletions __snapshots__/props-initialview.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ exports[`Props/initialView Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down Expand Up @@ -447,12 +445,12 @@ exports[`Props/initialView Month test 1`] = `
day
</span>
</button>
<button data-testid="field_name-Tab-Month"
<button aria-selected="true"
data-testid="field_name-Tab-Month"
disabled
id="field_name-Tab-Month"
role="tab"
type="button"
aria-selected="true"
disabled
>
<span>
month
Expand Down Expand Up @@ -538,11 +536,11 @@ exports[`Props/initialView Month test 1`] = `
>
May
</button>
<button aria-label="June 2023"
<button aria-current="date"
aria-label="June 2023"
class="dateOption Month"
data-testid="field_name-Calendar-Month-06"
type="button"
aria-current="date"
>
Jun
</button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-locale.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ exports[`Props/locale Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-max.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,6 @@ exports[`Props/max Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-min.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,6 @@ exports[`Props/min Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
5 changes: 3 additions & 2 deletions __snapshots__/props-onvalidationmessage.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ exports[`Props/onValidationMessage Implementation test 1`] = `
<span class="token string">
""
</span>
<span class="token punctuation">
,
</span>
<span class>
</span>
<span class>
Expand Down Expand Up @@ -654,8 +657,6 @@ exports[`Props/onValidationMessage Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-open.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ exports[`Props/open Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-ref.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,6 @@ exports[`Props/ref Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/props-required.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,6 @@ exports[`Props/required Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/required-props.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,6 @@ exports[`Required Props Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions __snapshots__/styling-css-themes.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ exports[`Styling/CSS (themes) Combined Import Theme Toggling test 1`] = `
<code class="language-jsx"
style="white-space: pre;"
>
<span class>
</span>
<span class>
</span>
<span class="token comment">
/*** Automatic theme ***/
</span>
Expand Down Expand Up @@ -314,8 +310,6 @@ exports[`Styling/CSS (themes) Combined Import Theme Toggling test 1`] = `
<span class="token punctuation">
}
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down Expand Up @@ -355,8 +349,6 @@ exports[`Styling/CSS (themes) Separate Import Vars test 1`] = `
<code class="language-jsx"
style="white-space: pre;"
>
<span class>
</span>
<span class>
body
</span>
Expand Down Expand Up @@ -934,8 +926,6 @@ exports[`Styling/CSS (themes) Separate Import Vars test 1`] = `
<span class="token punctuation">
}
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
2 changes: 0 additions & 2 deletions __snapshots__/validation.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,6 @@ exports[`Validation Implementation test 1`] = `
<span class="token punctuation">
;
</span>
<span class>
</span>
</code>
</pre>
<button>
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@babel/preset-react": "^7.22.5",
"@idesigncode/storybook-tools": "^2.1.3",
"@storybook/addon-coverage": "^0.0.8",
"@storybook/addon-docs": "^7.0.20",
"@storybook/addon-interactions": "^7.0.20",
"@storybook/addons": "^7.0.20",
"@idesigncode/storybook-tools": "^3.0.0",
"@storybook/addon-coverage": "^0.0.9",
"@storybook/addon-docs": "^7.1.1",
"@storybook/addon-interactions": "^7.1.1",
"@storybook/addons": "^7.1.1",
"@storybook/jest": "^0.1.0",
"@storybook/react": "^7.0.20",
"@storybook/react-webpack5": "^7.0.20",
"@storybook/test-runner": "^0.10.0",
"@storybook/testing-library": "^0.1.0",
"@storybook/react": "^7.1.1",
"@storybook/react-webpack5": "^7.1.1",
"@storybook/test-runner": "^0.12.0",
"@storybook/testing-library": "^0.2.0",
"autoprefixer": "^10.4.14",
"babel-plugin-inline-react-svg": "^2.0.2",
"cssnano": "^6.0.1",
Expand All @@ -132,8 +132,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.63.3",
"storybook": "^7.0.20",
"storybook-dark-mode": "^3.0.0",
"storybook": "^7.1.1",
"storybook-dark-mode": "^3.0.1",
"timeshift": "^0.0.2"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions stories/Props/As.stories.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const AsComponentImplementation = {
args: {
code: AsComponentExampleRaw,
},
render: Source,
render: (args) => <Source {...args} />,
};

export const AsComponentDateInput = {
Expand Down Expand Up @@ -57,7 +57,7 @@ export const AsTagNameImplementation = {
args: {
code: AsTagNameExampleRaw,
},
render: Source,
render: (args) => <Source {...args} />,
};

export const AsTagNameDateInput = {
Expand Down
2 changes: 1 addition & 1 deletion stories/Props/Children.stories.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Implementation = {
args: {
code: ChildrenExampleRaw.replace(/^\/\* eslint-disable.*\n/, ''),
},
render: Source,
render: (args) => <Source {...args} />,
};

export const AllChildren = {
Expand Down
2 changes: 1 addition & 1 deletion stories/Props/ClassName.stories.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Implementation = {
args: {
code: ClassNameExampleRaw,
},
render: Source,
render: (args) => <Source {...args} />,
};

export const OuterDiv = {
Expand Down
3 changes: 2 additions & 1 deletion stories/Props/Disabled.stories.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import Source from '@idesigncode/storybook-tools/Source.mjs';
import DateInputWithArgs, {
defaultArgs,
Expand All @@ -21,7 +22,7 @@ export const Implementation = {
args: {
code: DisabledExampleRaw,
},
render: Source,
render: (args) => <Source {...args} />,
};

export const UserInteraction = {
Expand Down
3 changes: 2 additions & 1 deletion stories/Props/DisplayFormat.stories.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import Source from '@idesigncode/storybook-tools/Source.mjs';
import DateInputWithArgs, {
defaultArgs,
Expand All @@ -21,7 +22,7 @@ export const Implementation = {
args: {
code: DisplayFormatExampleRaw,
},
render: Source,
render: (args) => <Source {...args} />,
};

export const MonthYearDay = {
Expand Down
9 changes: 4 additions & 5 deletions stories/Props/Format.stories.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import Source from '@idesigncode/storybook-tools/Source.mjs';
import DateInputWithArgs, {
defaultArgs,
Expand All @@ -21,7 +22,7 @@ export const Implementation = {
args: {
code: FormatExampleRaw,
},
render: Source,
render: (args) => <Source {...args} />,
};

export const FormatValue = {
Expand All @@ -33,10 +34,8 @@ export const FormatValue = {
await step(
'The [onChange] function receives the `formatValue` in the given [format]',
async () => {
await userEvent.paste(
within(canvasElement).getByTestId('field_name'),
'30/12/2000'
);
await within(canvasElement).getByTestId('field_name').focus();
await userEvent.paste('30/12/2000');
expect(args.onChange).toHaveBeenLastCalledWith(
expect.objectContaining({ _reactName: 'onChange' }),
'12-2000-30'
Expand Down
Loading

0 comments on commit 94985ec

Please sign in to comment.