import React from 'react';
import { mount, shallow, render } from 'enzyme';
const fixtureData = require('./fixtures/misawa-homes-chugoku.json');
import ConnectionMap from '@src/connection-map.component';

describe('Connection map components', () => {
	beforeEach(() => {
		Object.defineProperty(Element.prototype, 'clientHeight', {
			get() {
				return 100;
			},
			enumerable: true,
			configurable: true
		});
	});

	it('Renders a connection map component', () => {
		const connectionMap = mount(
			<ConnectionMap
				requestId="065Q0Y-E"
				connectionsData={fixtureData}
				onNavigateToCompanyPage={() => null}
				onNavigateToConnectionMap={() => null}
				onViewCompany={() => null}
				onViewLatestNews={() => null}
				onAddToTargetList={() => null}
			/>
		);

		expect(connectionMap).toMatchSnapshot();
	});
});
