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

Add tests for define story helper #485

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 13 additions & 13 deletions packages/component-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@floating-ui/vue": "^1.1.5",
"@shopware-ag/meteor-icon-kit": "workspace:*",
"@shopware-ag/meteor-tokens": "workspace:*",
"@storybook/addon-a11y": "^8.4.5",
"@storybook/addon-a11y": "^8.5.1",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/vue": "^8.1.0",
"@tiptap/extension-bubble-menu": "^2.10.0",
Expand Down Expand Up @@ -85,17 +85,17 @@
"@csstools/stylelint-formatter-github": "^1.0.0",
"@rushstack/eslint-patch": "^1.3.3",
"@shopware-ag/stylelint-plugin-meteor": "workspace:*",
"@storybook/addon-essentials": "^8.4.5",
"@storybook/addon-interactions": "^8.4.5",
"@storybook/addon-links": "^8.4.5",
"@storybook/blocks": "^8.4.5",
"@storybook/manager-api": "^8.4.5",
"@storybook/preview-api": "^8.4.5",
"@storybook/test": "^8.4.5",
"@storybook/test-runner": "^0.19.1",
"@storybook/theming": "^8.4.5",
"@storybook/vue3": "^8.4.5",
"@storybook/vue3-vite": "^8.4.5",
"@storybook/addon-essentials": "^8.5.1",
"@storybook/addon-interactions": "^8.5.1",
"@storybook/addon-links": "^8.5.1",
"@storybook/blocks": "^8.5.1",
"@storybook/manager-api": "^8.5.1",
"@storybook/preview-api": "^8.5.1",
"@storybook/test": "^8.5.1",
"@storybook/test-runner": "^0.21.0",
"@storybook/theming": "^8.5.1",
"@storybook/vue3": "^8.5.1",
"@storybook/vue3-vite": "^8.5.1",
"@testing-library/user-event": "^14.6.0",
"@tsconfig/node18": "^18.2.2",
"@types/jsdom": "^21.1.3",
Expand All @@ -120,7 +120,7 @@
"postcss-html": "^1.7.0",
"prettier": "3.2.5",
"sass": "^1.69.5",
"storybook": "^8.4.5",
"storybook": "^8.5.1",
"storybook-dark-mode": "^4.0.2",
"stylelint": "^16.10.0",
"stylelint-config-standard-scss": "^13.1.0",
Expand Down
29 changes: 29 additions & 0 deletions packages/component-library/src/_internal/story-helper.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { describe, it, expect } from "vitest";
import { defineStory } from "./story-helper";

describe("story-helper", () => {
describe("defineStory", () => {
it("should return the same structure it received as input", () => {
// ARRANGE
const subject = defineStory;

// ACT
const result = subject({
name: "The name of the test",
args: {
disabled: true,
modelValue: "Foo",
},
});

// ASSERT
expect(result).toStrictEqual({
name: "The name of the test",
args: {
disabled: true,
modelValue: "Foo",
},
});
});
});
});
Loading
Loading