Skip to content

Commit 2c43de5

Browse files
committed
migrated SuccessStory files to .tsx and updated snapshot
1 parent 3190c8b commit 2c43de5

File tree

6 files changed

+48
-36
lines changed

6 files changed

+48
-36
lines changed

components/SuccessStory/SuccessStory.js

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import FlatCard from 'components/Cards/FlatCard/FlatCard';
2+
3+
export type SuccessStoryPropsType = {
4+
/**
5+
* Path to image used on the card.
6+
*/
7+
imageSource: string;
8+
/**
9+
* String applied tot he block quote element.
10+
*/
11+
quote: string;
12+
/**
13+
* String applied to the card header.
14+
*/
15+
title: string;
16+
};
17+
18+
function SuccessStory({ imageSource, quote, title }: SuccessStoryPropsType) {
19+
return (
20+
<FlatCard header={title} image={{ source: imageSource, alt: '' }}>
21+
<blockquote>{`"${quote}"`}</blockquote>
22+
</FlatCard>
23+
);
24+
}
25+
26+
export default SuccessStory;

components/SuccessStory/__stories__/SuccessStory.stories.js

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
import { descriptions } from 'common/constants/descriptions';
3+
import { s3 } from 'common/constants/urls';
4+
import SuccessStory from '../SuccessStory';
5+
6+
type SuccessStoryType = StoryObj<typeof SuccessStory>;
7+
8+
const meta: Meta<typeof SuccessStory> = {
9+
title: 'SuccesStory',
10+
component: SuccessStory,
11+
args: {
12+
title: 'Name of Person',
13+
imageSource: `${s3}headshots/david_molina.jpg`,
14+
quote: descriptions.long,
15+
},
16+
};
17+
18+
export default meta;
19+
20+
export const Default: SuccessStoryType = {
21+
render: args => <SuccessStory {...args} />,
22+
};

components/SuccessStory/__tests__/SuccessStory.test.js renamed to components/SuccessStory/__tests__/SuccessStory.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import createShallowSnapshotTest from 'test-utils/createShallowSnapshotTest';
2-
32
import SuccessStory from '../SuccessStory';
43

54
describe('SuccessStory', () => {

0 commit comments

Comments
 (0)