Skip to content

Instantly share code, notes, and snippets.

View DinAlla's full-sized avatar

Magidova Angelina DinAlla

View GitHub Profile
describe(ExampleComponent testing', () => {
test('should render correctly', () => {
const wrapper = shallow(
<ExampleComponent />
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
window.history.pushState(
{},
'',
describe(ExampleComponent testing', () => {
test('should render correctly', () => {
const wrapper = shallow(
<ExampleComponent />
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
window.history.assign(‘/newPathname’);
const newWrapper = shallow(
<ExampleComponent />
const ExampleComponent= (props: Props) => (
{window.location.pathname === '/newPathname’ &&
<button><button/>
}
<button><button/>
);
export default ExampleComponent;