From cbaeb9dabcb7fcaa33281ce026439874ebe12a9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kuty=C5=82a?= Date: Wed, 29 Jul 2020 19:18:38 +0200 Subject: [PATCH] 16627: Replaced push with replace for history MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- src/components/refresh-button/refresh-button.test.tsx | 4 ++-- src/components/refresh-button/refresh-button.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/refresh-button/refresh-button.test.tsx b/src/components/refresh-button/refresh-button.test.tsx index f6372e5c..fe7b609d 100644 --- a/src/components/refresh-button/refresh-button.test.tsx +++ b/src/components/refresh-button/refresh-button.test.tsx @@ -16,7 +16,7 @@ describe('', () => { beforeEach(() => { props = { history: { - push: jest.fn(), + replace: jest.fn(), }, classes: {}, }; @@ -38,6 +38,6 @@ describe('', () => { wrapper.find(Button).simulate('click'); // then - expect(props.history.push).toHaveBeenCalledWith('/'); + expect(props.history.replace).toHaveBeenCalledWith('/'); }); }); diff --git a/src/components/refresh-button/refresh-button.tsx b/src/components/refresh-button/refresh-button.tsx index f34a0213..66bda99e 100644 --- a/src/components/refresh-button/refresh-button.tsx +++ b/src/components/refresh-button/refresh-button.tsx @@ -28,7 +28,7 @@ export const RefreshButton = ({ history, classes }: RouteComponentProps & WithSt size="small" variant="contained" onClick={() => { - history.push(window.location.pathname); + history.replace(window.location.pathname); }} className={classNames(classes.buttonRight, classes.button)}> -- 2.30.2