Added some feedback to know which cardsin overview pages are clickable

This commit is contained in:
Alejandro Celaya
2022-02-05 10:46:46 +01:00
parent e0d43020dc
commit 60929342fb
3 changed files with 16 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ import { shallow, ShallowWrapper } from 'enzyme';
import { ReactNode } from 'react';
import { Card, CardText, CardTitle } from 'reactstrap';
import { Link } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { HighlightCard, HighlightCardProps } from '../../../src/servers/helpers/HighlightCard';
describe('<HighlightCard />', () => {
@@ -20,6 +21,7 @@ describe('<HighlightCard />', () => {
expect(wrapper.find(Card)).toHaveLength(1);
expect(wrapper.find(CardTitle)).toHaveLength(1);
expect(wrapper.find(CardText)).toHaveLength(1);
expect(wrapper.find(FontAwesomeIcon)).toHaveLength(0);
expect(wrapper.prop('tag')).not.toEqual(Link);
expect(wrapper.prop('to')).not.toBeDefined();
});
@@ -53,6 +55,7 @@ describe('<HighlightCard />', () => {
])('adds extra props when a link is provided', (link) => {
const wrapper = createWrapper({ title: 'foo', link });
expect(wrapper.find(FontAwesomeIcon)).toHaveLength(1);
expect(wrapper.prop('tag')).toEqual(Link);
expect(wrapper.prop('to')).toEqual(link);
});