Skip to content

Commit be4042f

Browse files
Merge branch 'master' into feature/add-code-icon-1449
2 parents 7f39576 + b3e1404 commit be4042f

4 files changed

Lines changed: 53 additions & 0 deletions

File tree

src/__testing__/ReplyIcon.test.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { render } from '@testing-library/react';
2+
import { ReplyIcon } from '../icons';
3+
4+
describe('ReplyIcon', () => {
5+
it('renders without errors', () => {
6+
render(<ReplyIcon width={24} height={24} />);
7+
});
8+
9+
it('uses default width and height', () => {
10+
const { getByTestId } = render(<ReplyIcon />);
11+
const svgElement = getByTestId('reply-icon-svg');
12+
expect(svgElement.getAttribute('width')).toBe('24');
13+
expect(svgElement.getAttribute('height')).toBe('24');
14+
});
15+
16+
it('applies custom width and height', () => {
17+
const { getByTestId } = render(<ReplyIcon width={32} height={32} />);
18+
const svgElement = getByTestId('reply-icon-svg');
19+
expect(svgElement.getAttribute('width')).toBe('32');
20+
expect(svgElement.getAttribute('height')).toBe('32');
21+
});
22+
});

src/icons/Reply/ReplyIcon.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL_NONE } from '../../constants/constants';
2+
import { IconProps } from '../types';
3+
4+
export const ReplyIcon = ({
5+
width = DEFAULT_WIDTH,
6+
height = DEFAULT_HEIGHT,
7+
fill = DEFAULT_FILL_NONE,
8+
title,
9+
...props
10+
}: IconProps): JSX.Element => {
11+
return (
12+
<svg
13+
width={width}
14+
height={height}
15+
xmlns="http://www.w3.org/2000/svg"
16+
viewBox="0 0 24 24"
17+
data-testid="reply-icon-svg"
18+
{...props}
19+
>
20+
{title && <title>{title}</title>}
21+
<path
22+
d="M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-10z"
23+
fill={fill}
24+
/>
25+
</svg>
26+
);
27+
};
28+
29+
export default ReplyIcon;

src/icons/Reply/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ReplyIcon } from './ReplyIcon';

src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export * from './Rectangle';
137137
export * from './Redo';
138138
export * from './Refresh';
139139
export * from './Remove';
140+
export * from './Reply';
140141
export * from './Reset';
141142
export * from './Resize';
142143
export * from './Response';

0 commit comments

Comments
 (0)