Skip to content

Commit 0499bce

Browse files
Merge branch 'master' into barchart
2 parents d28b4d0 + 9a8c19f commit 0499bce

7 files changed

Lines changed: 97 additions & 0 deletions

File tree

src/__testing__/CodeIcon.test.tsx

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

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/Code/CodeIcon.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_FILL_NONE } from '../../constants/constants';
2+
import { IconProps } from '../types';
3+
4+
export const CodeIcon = ({
5+
width = DEFAULT_WIDTH,
6+
height = DEFAULT_HEIGHT,
7+
fill = DEFAULT_FILL_NONE,
8+
...props
9+
}: IconProps): JSX.Element => {
10+
return (
11+
<svg
12+
width={width}
13+
height={height}
14+
xmlns="http://www.w3.org/2000/svg"
15+
viewBox="0 0 24 24"
16+
data-testid="code-icon-svg"
17+
{...props}
18+
>
19+
<path
20+
d="M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"
21+
fill={fill}
22+
/>
23+
</svg>
24+
);
25+
};
26+
27+
export default CodeIcon;

src/icons/Code/index.ts

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

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export * from './Circle';
3333
export * from './Clone';
3434
export * from './Close';
3535
export * from './Cloud';
36+
export * from './Code';
3637
export * from './CollapseAll';
3738
export * from './Column';
3839
export * from './CompareArrows';
@@ -137,6 +138,7 @@ export * from './Rectangle';
137138
export * from './Redo';
138139
export * from './Refresh';
139140
export * from './Remove';
141+
export * from './Reply';
140142
export * from './Reset';
141143
export * from './Resize';
142144
export * from './Response';

0 commit comments

Comments
 (0)