diff --git a/lib/components/tag-chip/index.tsx b/lib/components/tag-chip/index.tsx index 56c259957..fb1aad8e9 100644 --- a/lib/components/tag-chip/index.tsx +++ b/lib/components/tag-chip/index.tsx @@ -2,18 +2,22 @@ import React, { FunctionComponent } from 'react'; import classNames from 'classnames'; type OwnProps = { - onSelect: () => any; + onSelect?: (event: React.MouseEvent) => any; selected: boolean; - tag: string; + tagName: string; }; -const TagChip: FunctionComponent = ({ onSelect, selected, tag }) => ( +const TagChip: FunctionComponent = ({ + onSelect, + selected, + tagName +}) => (
- {tag} + {tagName}
); diff --git a/lib/components/tag-chip/test.tsx b/lib/components/tag-chip/test.tsx index 20fbb7e29..313c8e5eb 100644 --- a/lib/components/tag-chip/test.tsx +++ b/lib/components/tag-chip/test.tsx @@ -8,7 +8,7 @@ describe('TagChip', () => { it('should select tag when clicked', () => { const selectIt = jest.fn(); - const chip = mount(); + const chip = mount(); expect(selectIt).not.toHaveBeenCalled(); chip.simulate('click'); @@ -16,19 +16,19 @@ describe('TagChip', () => { }); it('should not include the `selected` class by default', () => { - const chip = shallow(); + const chip = shallow(); expect(chip.hasClass('selected')).toBe(false); }); it('should include the `selected` class when selected', () => { - const chip = shallow(); + const chip = shallow(); expect(chip.hasClass('selected')).toBe(true); }); it('should toggle the `selected` class with prop changes', () => { - const chip = shallow(); + const chip = shallow(); expect(chip.hasClass('selected')).toBe(false); @@ -42,7 +42,7 @@ describe('TagChip', () => { }); it('should not introduce visual regressions', () => { - const component = renderer.create().toJSON(); + const component = renderer.create().toJSON(); expect(component).toMatchSnapshot(); }); diff --git a/lib/tag-field/index.tsx b/lib/tag-field/index.tsx index 57937b6d7..ab4401dc2 100644 --- a/lib/tag-field/index.tsx +++ b/lib/tag-field/index.tsx @@ -249,7 +249,7 @@ export class TagField extends Component { {tags.filter(negate(isEmailTag)).map((tag) => (