Added back button to visits stats page

This commit is contained in:
Alejandro Celaya
2020-04-26 10:43:00 +02:00
parent 9ba8bc8f3d
commit dd728d4d13
4 changed files with 31 additions and 7 deletions

View File

@@ -18,6 +18,9 @@ describe('<ShortUrlVisits />', () => {
params: { shortCode: 'abc123' },
};
const location = { search: '' };
const history = {
goBack: jest.fn(),
};
const createComponent = (shortUrlVisits) => {
const ShortUrlVisits = createShortUrlVisits({ processStatsFromVisits, normalizeVisits: identity }, () => '');
@@ -28,6 +31,7 @@ describe('<ShortUrlVisits />', () => {
getShortUrlVisits={getShortUrlVisitsMock}
match={match}
location={location}
history={history}
shortUrlVisits={shortUrlVisits}
shortUrlDetail={{}}
cancelGetShortUrlVisits={identity}

View File

@@ -17,9 +17,10 @@ describe('<VisitsHeader />', () => {
const shortUrlVisits = {
visits: [{}, {}, {}],
};
const goBack = jest.fn();
beforeEach(() => {
wrapper = shallow(<VisitsHeader shortUrlDetail={shortUrlDetail} shortUrlVisits={shortUrlVisits} />);
wrapper = shallow(<VisitsHeader shortUrlDetail={shortUrlDetail} shortUrlVisits={shortUrlVisits} goBack={goBack} />);
});
afterEach(() => wrapper.unmount());