Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("adds author profile fields to tracking context", () => {
const reporter = jest.fn();
const pageSize = 3;
renderer.create(
);
expect(reporter).toHaveBeenCalledWith(
expect.objectContaining({
object: "AuthorProfile",
attrs: expect.objectContaining({
authorName: "Deborah Haynes",
page: 1,
pageSize
})
it("renders page error", () => {
const wrapper = shallow(
{}}
onTwitterLinkPress={() => {}}
onArticlePress={() => {}}
onViewed={() => {}}
/>
);
expect(
wrapper
.dive()
.dive()
it("should render styling correctly", () => {
const pageSize = 3;
const tree = renderer.create(
);
expect(tree).toMatchSnapshot();
});
};
it("does not emit scroll tracking events for author profile content when nothing changed", () => {
const reporter = jest.fn();
const results = pagedResult(0, 3);
const authorProfileContent = shallow(
{}}
onArticlePress={() => {}}
/>,
{
context: {
tracking: {
analytics: reporter
}
}
}
);
authorProfileContent
it("emits scroll tracking events for author profile content", () => {
const reporter = jest.fn();
const results = pagedResult(0, 3);
const authorProfileContent = shallow(
{}}
onArticlePress={() => {}}
/>,
{
context: {
tracking: {
analytics: reporter
}
}
}
);
authorProfileContent
it("renders profile loading", () => {
const pageSize = 3;
const component = renderer.create(
);
expect(component).toMatchSnapshot();
});
export default () => {
const pageSize = 3;
const slug = "chelsea";
const mockArticles = fixtureGenerator.makeTopicArticleMocks({
pageSize,
withImages: true
});
const props = {
adConfig: {},
analyticsStream: () => {},
isLoading: false,
onArticlePress: () => {},
page: 1,
pageSize,
refetch: () => {},
slug,
topic: {
name: "Chelsea",
description:
export default (skip, first) => ({
articles: {
...articleListWithImagesFixture.data.author.articles,
list: articleListWithImagesFixture.data.author.articles.list.slice(
skip,
skip + first
)
}
});
export default (skip, first) => ({
articles: {
...articleListWithImagesFixture.data.author.articles,
list: articleListWithImagesFixture.data.author.articles.list.slice(
skip,
skip + first
)
}
});
component: ({ select }, { decorateAction }) => {
const id = "198c4b2f-ecec-4f34-be53-c89f83bc1b44";
const scale = selectScales(select);
const section = selectSection(select);
return mockArticle({
decorateAction,
id,
params: makeParams({
error: () => new Error("Article error"),
variables: () => ({
id
})
}),
scale,
section
});
},
name: "Magazine Comment - Error",