mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 01:53:51 +00:00
Added some feedback to know which cardsin overview pages are clickable
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user