File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 1+ export { default as ReplyIcon } from './ReplyIcon' ;
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ export * from './Rectangle';
137137export * from './Redo' ;
138138export * from './Refresh' ;
139139export * from './Remove' ;
140+ export * from './Reply' ;
140141export * from './Reset' ;
141142export * from './Resize' ;
142143export * from './Response' ;
You can’t perform that action at this time.
0 commit comments