storybook/docs/snippets/common/storybook-test-with-storyname.js.mdx
2020-10-07 12:23:34 +08:00

17 lines
427 B
Plaintext

```js
// MyComponent-test.js
it('should format CSF exports with sensible defaults', () => {
const testCases = {
name: 'Name',
someName: 'Some Name',
someNAME: 'Some NAME',
some_custom_NAME: 'Some Custom NAME',
someName1234: 'Some Name 1234',
someName1_2_3_4: 'Some Name 1 2 3 4',
};
Object.entries(testCases).forEach(([key, val]) => {
expect(storyNameFromExport(key)).toBe(val);
});
});
```