Skip to content

Commit fe5c8e8

Browse files
author
Zaid Lahham
committed
fixup! LFR-3192: Add Chip component for tags
1 parent ff600e8 commit fe5c8e8

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

packages/core/src/components/Chip/Chip.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
width: auto;
1010
border: 1px solid var(--color-greyDarkest);
1111
box-sizing: border-box;
12-
font-weight: 600;
12+
font-weight: var(--fontweight-demi);
1313
font-size: var(--fontsize-small-ii);
1414
}
1515

packages/core/src/components/Chip/Chip.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ import * as React from 'react';
44
import cx from "classnames";
55
import css from "./Chip.css";
66

7-
type
8-
Props = {
7+
type Props = {
98
className?: string,
109
href: string,
1110
text: string,
1211
};
1312

1413
const Chip = ({className, href, text}: Props) => (
1514
<a href={href} className={cx(css.root, className)}>
16-
<div>
17-
{text}
18-
</div>
15+
{text}
1916
</a>
2017
);
2118

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
import React from 'react';
2-
import { render } from 'react-dom';
3-
2+
import { fireEvent, render } from '@testing-library/react';
43
import Chip from './Chip';
54

65
it('renders without crashing', () => {
76
const div = document.createElement('div');
87
render(
9-
<Chip />,
8+
<Chip/>,
109
div,
1110
);
1211
});
12+
13+
it('displays the correct text and href', () => {
14+
const { queryByText } = render(
15+
<Chip text="Active" href="https://appearhere.co.uk"/>,
16+
);
17+
18+
expect(queryByText(/Active/i)).toBeTruthy();
19+
expect(document.querySelector("a").getAttribute("href")).toBe("https://appearhere.co.uk");
20+
});

packages/core/src/globals/typography.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* ```
1414
*/
1515
:root {
16-
--font-avenir: 'Avenir Next', 'Helvetica Neue', 'Helvetica', 'sans-serif';
16+
--font-avenir: 'Avenir Next W01', 'Helvetica Neue', 'Helvetica', 'sans-serif';
1717
--font-fira-code: 'Fira Mono', monospace;
1818

1919
--fontweight-bold: 800;

0 commit comments

Comments
 (0)