/
topic-styling.js
40 lines (37 loc) · 1.16 KB
/
topic-styling.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import "jest-styled-components";
import React from "react";
import renderer from "react-test-renderer";
import {
fixtureGenerator,
MockedProvider
} from "@times-components/provider-test-tools";
import Topic from "../src/topic";
export default () => {
const props = {
adConfig: {},
analyticsStream: () => {},
isLoading: false,
onArticlePress: () => {},
refetch: () => {},
slug: "chelsea",
topic: {
name: "Chelsea",
description:
"Chelsea is known for its affluent residents and the posh shops and restaurants that cater to them. It’s a cultural haven too, with the Royal Court Theatre on Sloane Square and the modern Saatchi Gallery on the Duke of York Square. Close by, busy King’s Road is lined with mid- to high-end stores."
}
};
it("should render styling correctly", () => {
const pageSize = 3;
const tree = renderer.create(
<MockedProvider
mocks={fixtureGenerator.makeTopicArticleMocks({
pageSize,
withImages: true
})}
>
<Topic {...props} page={1} pageSize={pageSize} />
</MockedProvider>
);
expect(tree).toMatchSnapshot();
});
};