digitransit-ui/test/unit/component/map/MarkerPopupBottom.test.js
Vesa Meskanen 59c6d226be refactor: remove messy dependencies from markerpopupbottom
Popup no longer includes logic of the views on which it opens
2021-01-06 10:25:27 +02:00

28 lines
759 B
JavaScript

import React from 'react';
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { mountWithIntl } from '../../helpers/mock-intl-enzyme';
import { Component as MarkerPopupBottomWithoutLeaflet } from '../../../../app/component/map/MarkerPopupBottom';
describe('<MarkerPopupBottom />', () => {
it('should render a viapoint button when asked so', () => {
const props = {
location: {},
leaflet: {
map: {
closePopup: () => {},
},
},
locationPopup: 'all',
onSelectLocation: () => null,
};
const wrapper = mountWithIntl(
<MarkerPopupBottomWithoutLeaflet {...props} />,
{},
);
expect(wrapper.find('.route-add-viapoint').length).to.equal(1);
});
});