Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const count = 12;
getOpenedPuzzleCount.mockReturnValue(Promise.resolve(count));
const testInstance = TestRenderer.create(
);
// Initial Count
expect(testInstance.toJSON()).toEqual(`${initialCount}`);
// Updated Count with native bridge
await delay(0);
expect(testInstance.toJSON()).toEqual(`${count}`);
});
};
it("check that the event default is properly prevented", async () => {
const testInstance = TestRenderer.create(
);
const [saveStarLink] = testInstance.root.findAllByType(Link);
await delay(0);
const preventDefault = jest.fn();
saveStarLink.props.onPress({ preventDefault });
expect(preventDefault).toHaveBeenCalled();
});
});
it("should send multiple events", async () => {
setup();
const e1 = { component: "Page1" };
const e2 = { component: "Page2" };
sendScheduler.enqueue(e1);
sendScheduler.enqueue(e2);
await delayAndAdvance(1000);
expect(global.window.tealiumTrack).toHaveBeenCalledTimes(2);
});
}
};
expect(
makeTest(
)
).toMatchSnapshot();
}
}
];
iterator(tests);
};
test: () => {
const testInstance = TestRenderer.create(
{}}
slug="test-slug"
/>
);
expect(testInstance).toMatchSnapshot();
}
}
];
iterator(tests);
};
.find("ArticleListPagination")
.at(1)
.dive()
.find("WithTrackEvents(Pagination)")
.dive()
.dive()
.find("Link")
.props()
.onPress();
spy.mockRestore();
}
}
];
iterator(tests);
};
fillOpacity="0.4"
height="100"
stroke="rgb(255,255,255)"
strokeWidth="8"
width="100"
x="5"
y="10"
/>
);
expect(testInstance).toMatchSnapshot();
}
}
];
iterator(tests);
};
{
name: "secondary image with caption and credits",
test: () => {
expect(
makeTest(
)
).toMatchSnapshot();
}
}
];
iterator(tests);
};
const testInstance = TestRenderer.create(
{}}
pageSize={3}
refetch={() => {}}
/>
);
expect(testInstance).toMatchSnapshot();
}
}
];
iterator(tests);
};
{...props}
analyticsStream={reporter}
page={1}
pageSize={pageSize}
/>
);
const call = reporter.mock.calls[0][0];
expect(call).toMatchSnapshot();
}
}
];
iterator(tests);
};