Skip to content

New Contentful components and updates #2986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions __tests__/shared/components/Contentful/Image/Image.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import Renderer from 'react-test-renderer/shallow';
import { ImageInner } from 'components/Contentful/Image/Image';

test('Matches shallow shapshot', () => {
const renderer = new Renderer();
const MOCK_PROPS = {
id: '1',
image: {},
imageSource: {
file: {
url: 'https://www.topcoder.com',
},
},
clipSvg: {
file: {
url: 'https://www.topcoder.com',
},
},
theme: {},
};
renderer.render(<ImageInner {...MOCK_PROPS} />);
expect(renderer.getRenderOutput()).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Matches shallow shapshot 1`] = `
<div
id="image-1"
>
<InlineSVG
baseURL=""
cacheGetRequests={false}
onLoad={[Function]}
preloader={
<ThemedLoadingIndicator
composeAdhocTheme="deeply"
composeContextTheme="softly"
mapThemrProps={[Function]}
themePriority="adhoc-context-default"
/>
}
src="https://www.topcoder.com"
supportTest={[Function]}
uniquifyIDs={true}
wrapper={[Function]}
/>
<img
alt=""
src="https://www.topcoder.com"
style={
Object {
"display": "none",
}
}
/>
</div>
`;
19 changes: 19 additions & 0 deletions __tests__/shared/components/Contentful/Shape/Shape.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import Renderer from 'react-test-renderer/shallow';
import { ShapeInner } from 'components/Contentful/Shape/Shape';

test('Matches shallow shapshot', () => {
const renderer = new Renderer();
const MOCK_PROPS = {
id: '1',
shape: {},
shapeSvg: {
file: {
url: 'https://www.topcoder.com',
},
},
theme: {},
};
renderer.render(<ShapeInner {...MOCK_PROPS} />);
expect(renderer.getRenderOutput()).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Matches shallow shapshot 1`] = `
<div
id="1"
style={
Object {
"backgroundImage": "url(https://www.topcoder.com)",
}
}
/>
`;
Loading