Updated ScrollToTop to be a functional component

This commit is contained in:
Alejandro Celaya
2020-05-31 09:50:00 +02:00
parent b7fd2308ad
commit 4bd83eecfb
3 changed files with 17 additions and 21 deletions

View File

@@ -20,9 +20,4 @@ describe('<ScrollToTop />', () => {
});
it('just renders children', () => expect(wrapper.text()).toEqual('Foobar'));
it('scrolls to top when location changes', () => {
wrapper.instance().componentDidUpdate({ location: { href: 'bar' } });
expect(window.scrollTo).toHaveBeenCalledTimes(1);
});
});