diff --git a/src/Components/CreateImageWizard/CreateImageWizard.js b/src/Components/CreateImageWizard/CreateImageWizard.js index 45904b4b..dcba5538 100644 --- a/src/Components/CreateImageWizard/CreateImageWizard.js +++ b/src/Components/CreateImageWizard/CreateImageWizard.js @@ -117,7 +117,7 @@ const CreateImageWizard = () => { })(); }, []); return user ? navigate('/landing') } + onClose={ () => navigate('/') } onSubmit={ ({ values, setIsSaving }) => { setIsSaving(() => true); const requests = onSave(values); @@ -129,7 +129,7 @@ const CreateImageWizard = () => { }, true)); }))) .then(() => { - navigate('/landing'); + navigate('/'); dispatch(addNotification({ variant: 'success', title: 'Your image is being created', diff --git a/src/Router.js b/src/Router.js index 13fe3911..0b399510 100644 --- a/src/Router.js +++ b/src/Router.js @@ -1,5 +1,5 @@ import React, { lazy } from 'react'; -import { Route, Routes, Navigate } from 'react-router-dom'; +import { Route, Routes } from 'react-router-dom'; const LandingPage = lazy(() => import('./Components/LandingPage/LandingPage')); const CreateImageWizard = lazy(() => import('./Components/CreateImageWizard/CreateImageWizard')); @@ -7,9 +7,8 @@ const CreateImageWizard = lazy(() => import('./Components/CreateImageWizard/Crea export const Router = () => { return ( - } /> } /> - } /> + } /> ); }; diff --git a/src/test/Components/CreateImageWizard/CreateImageWizard.test.js b/src/test/Components/CreateImageWizard/CreateImageWizard.test.js index 72c57cd4..542f3e78 100644 --- a/src/test/Components/CreateImageWizard/CreateImageWizard.test.js +++ b/src/test/Components/CreateImageWizard/CreateImageWizard.test.js @@ -23,7 +23,7 @@ function verifyButtons() { function verifyCancelButton(cancel, history) { cancel.click(); - expect(history.location.pathname).toBe('/landing'); + expect(history.location.pathname).toBe('/'); } // packages @@ -860,7 +860,7 @@ describe('Click through all steps', () => { await expect(composeImage).toHaveBeenCalledTimes(3); // returns back to the landing page - await waitFor(() => expect(history.location.pathname).toBe('/landing')); + await waitFor(() => expect(history.location.pathname).toBe('/')); expect(store.getStore().getState().composes.allIds).toEqual(ids); });