saagie-ui
Version:
Saagie UI from Saagie Design System
30 lines (23 loc) • 687 B
JavaScript
import React from 'react';
import { mount } from 'enzyme';
import { MapInteraction } from '../MapInteraction';
describe('MapInteraction', () => {
it('should call this.setPointerState() if newTranslation and newScale changed', () => {
const handleChange = jest.fn();
const currentProps = {
transform: { scale: 0, x: 0, y: 0 },
onChange: handleChange,
};
const newProps = {
...currentProps,
transform: { scale: 1, x: 1, y: 1 },
};
const component = mount(
<MapInteraction {...currentProps}>
<div />
</MapInteraction>
);
component.setProps(newProps);
expect(handleChange).toHaveBeenCalled();
});
});