Tests for Pin rendering component

This commit is contained in:
Jeff Avallone 2019-01-31 21:15:11 -05:00
parent ee915c39dc
commit 47ee62d387
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Pin layout 1`] = `
Object {
"box": Object {
"height": 10,
"width": 10,
},
"type": "Pin",
}
`;
exports[`Pin rendering 1`] = `
<circle
r={5}
style={
Object {
"fill": "#6b6659",
"stroke": "#000",
"strokeWidth": "2px",
}
}
transform="translate(5 5)"
/>
`;

20
src/rendering/Pin/test.js Normal file
View File

@ -0,0 +1,20 @@
import React from 'react';
import { shallow } from 'enzyme';
import Pin, { layout } from 'rendering/Pin';
describe('Pin', () => {
test('rendering', () => {
const component = shallow(
<Pin/>
);
expect(component).toMatchSnapshot();
});
test('layout', () => {
const processed = layout({
type: 'Pin'
});
expect(processed).toMatchSnapshot();
});
});