UNPKG

react-spatial

Version:

Components to build React map apps.

21 lines (18 loc) 678 B
import 'jest-canvas-mock'; import React from 'react'; import { configure } from 'enzyme'; import OLMap from 'ol/Map'; import OLView from 'ol/View'; import Adapter from 'enzyme-adapter-react-16'; import renderer from 'react-test-renderer'; import ScaleLine from './ScaleLine'; configure({ adapter: new Adapter() }); describe('ScaleLine', function () { test('matches snapshot', function () { var map = new OLMap({ view: new OLView({ zoom: 7, center: [0, 0] }) }); var component = renderer.create(React.createElement( ScaleLine, { map: map })); var tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); }); //# sourceMappingURL=ScaleLine.test.js.map