mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-07-06 01:00:37 +02:00
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
|
|
import { ReactRelayContext } from 'react-relay';
|
|
|
|
import FuzzyTripLink from '../../../app/component/routepage/FuzzyTripLink';
|
|
import VehicleIcon from '../../../app/component/VehicleIcon';
|
|
import { mountWithIntl } from '../helpers/mock-intl-enzyme';
|
|
|
|
describe('<FuzzyTripLink />', () => {
|
|
it('should render content and icon', () => {
|
|
const props = {
|
|
trip: {
|
|
trip: {
|
|
route: {
|
|
gtfsId: 'OULU:15',
|
|
},
|
|
pattern: {
|
|
code: '1',
|
|
},
|
|
gtfsId: 'OULU:12345',
|
|
},
|
|
},
|
|
vehicle: {
|
|
direction: 0,
|
|
mode: 'bus',
|
|
operatingDay: '2020-05-09',
|
|
route: 'HSL:2550',
|
|
tripStartTime: '2143',
|
|
shortName: '550',
|
|
},
|
|
stopName: '1',
|
|
nextStopName: '2',
|
|
};
|
|
const environment = {};
|
|
|
|
const wrapper = mountWithIntl(
|
|
<ReactRelayContext.Provider value={{ environment }}>
|
|
<FuzzyTripLink {...props} />
|
|
</ReactRelayContext.Provider>,
|
|
);
|
|
expect(wrapper.find('.route-now-content')).to.have.lengthOf(1);
|
|
expect(wrapper.find(VehicleIcon)).to.have.lengthOf(1);
|
|
});
|
|
});
|