@kiwicom/smart-faq
Version:
66 lines (56 loc) • 1.32 kB
JavaScript
// @flow
import * as React from 'react';
import { render } from 'enzyme';
import { ThemeProvider } from 'styled-components';
import { RawMulticityBookingHeader } from '../Multicity';
describe('MulticityBookingHeaderWay', () => {
const mockRefType: any = null;
const booking = {
trips: [
{
departure: {
airport: {
city: {
name: 'Zarss',
},
},
},
},
{
departure: {
airport: {
city: {
name: 'Golgafrincham',
},
},
},
},
],
end: {
airport: {
city: {
name: 'Vogsphere',
},
},
},
$refType: mockRefType,
};
it('should display the city names in right order', () => {
const wrapper = render(<RawMulticityBookingHeader booking={booking} />);
expect(wrapper.text()).toEqual('ZarssGolgafrinchamVogsphere');
});
it('should reverse the city names for rtl languages', () => {
const theme = {
orbit: {
fontFamily: 'Comic Sans',
},
rtl: true,
};
const result = render(
<ThemeProvider theme={theme}>
<RawMulticityBookingHeader booking={booking} />
</ThemeProvider>,
);
expect(result).toMatchSnapshot();
});
});