Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies #42

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = {
addons: [
"../preset.js",
"@storybook/addon-essentials",
"@storybook/addon-knobs",
"@storybook/addon-interactions",
],
};
50 changes: 26 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@
},
"devDependencies": {
"@auto-it/released": "^10.32.6",
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.5",
"@babel/preset-typescript": "^7.12.5",
"@storybook/addon-essentials": "^6.2.9",
"@storybook/addon-knobs": "^6.2.9",
"@storybook/addon-storyshots": "^6.2.9",
"@storybook/eslint-config-storybook": "^3.0.0",
"@storybook/svelte": "^6.2.9",
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.5",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@storybook/addon-essentials": "^6.4.20",
"@storybook/addon-interactions": "^6.4.20",
"@storybook/jest": "^0.0.10",
"@storybook/testing-library": "^0.0.9",
"@storybook/addon-storyshots": "^6.4.20",
"@storybook/eslint-config-storybook": "^3.1.2",
"@storybook/svelte": "^6.4.20",
"auto": "^10.3.0",
"babel-jest": "^26.6.3",
"babel-loader": "^8.1.0",
Expand All @@ -60,24 +62,24 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rimraf": "^3.0.2",
"svelte": "^3.35.0",
"svelte-jester": "^1.3.2",
"svelte-loader": "^3.0.0",
"typescript": "^3.3.3333"
"svelte": "^3.46.6",
"svelte-jester": "^2.3.2",
"svelte-loader": "^3.1.2",
"typescript": "^3.9.7"
},
"peerDependencies": {
"@storybook/addons": "^6.2.9",
"@storybook/api": "^6.2.9",
"@storybook/client-api": "^6.2.9",
"@storybook/client-logger": "^6.2.9",
"@storybook/components": "^6.2.9",
"@storybook/core-events": "^6.2.9",
"@storybook/svelte": "^6.2.9",
"@storybook/theming": "^6.2.9",
"@storybook/addons": "^6.4.20",
"@storybook/api": "^6.4.20",
"@storybook/client-api": "^6.4.20",
"@storybook/client-logger": "^6.4.20",
"@storybook/components": "^6.4.20",
"@storybook/core-events": "^6.4.20",
"@storybook/svelte": "^6.4.20",
"@storybook/theming": "^6.4.20",
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0",
"svelte": "^3.35.0",
"svelte-loader": "^3.0.0"
"svelte": "^3.46.6",
"svelte-loader": "^3.1.2"
},
"peerDependenciesMeta": {
"svelte": {
Expand Down
10 changes: 10 additions & 0 deletions stories/Counter.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script>
let count = 0;
</script>

<div>
<h1>Counter</h1>
<h2 data-testid="count">You clicked {count} times</h2>
<button type="button" on:click={() => count--}>Decrement</button>
<button type="button" on:click={() => count++}>Increment</button>
</div>
36 changes: 36 additions & 0 deletions stories/__snapshots__/interaction.stories.storyshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Interactions Play 1`] = `
<section
class="storybook-snapshot-container"
>

<div>
<h1>
Counter
</h1>

<h2
data-testid="count"
>
You clicked
0
times
</h2>

<button
type="button"
>
Decrement
</button>

<button
type="button"
>
Increment
</button>
</div>


</section>
`;
21 changes: 21 additions & 0 deletions stories/interaction.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script>
import { Meta, Story } from '../src/index';
import { expect } from '@storybook/jest';
import { userEvent, within } from '@storybook/testing-library';

import Counter from './Counter.svelte';

async function play({canvasElement}) {
const canvas = within(canvasElement);
userEvent.click(await canvas.findByText('Increment'));

const count = await canvas.findByTestId('count');
expect(count.textContent).toEqual('You clicked 1 times');
}
</script>

<Meta title="Interactions" component={Counter} />

<Story name="Play" {play}>
<Counter />
</Story>
4 changes: 3 additions & 1 deletion stories/svelteshots.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ initStoryshots({
framework: 'svelte',
configPath: path.join(__dirname, '../.storybook'),
integrityOptions: { cwd: __dirname },
stories2snapsConverter: new Stories2SnapsConverter({ storiesExtensions: ['.js', '.svelte'] }),
stories2snapsConverter: new Stories2SnapsConverter({
storiesExtensions: ['.js', '.svelte'],
snapshotsDirName: '../__snapshots__' }),
test: multiSnapshotWithOptions(),
});
Loading