test(welcome): align Router/Step1/Step2 stub routes with /home destination
Post-refactor, WelcomeRouter and the Step1/Step2 "Skip-the-rest" handlers navigate to /home, but the MemoryRouter test stubs still mounted the "dashboard" marker at /. Update the stub routes (and matching it() titles) so the assertions resolve. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ function renderRouter() {
|
||||
<Route path="/welcome/step-1" element={<div>step-1</div>} />
|
||||
<Route path="/welcome/step-2" element={<div>step-2</div>} />
|
||||
<Route path="/welcome/step-3" element={<div>step-3</div>} />
|
||||
<Route path="/" element={<div>dashboard</div>} />
|
||||
<Route path="/home" element={<div>dashboard</div>} />
|
||||
</Routes>
|
||||
</MemoryRouter>,
|
||||
)
|
||||
@@ -100,7 +100,7 @@ describe('WelcomeRouter', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('redirects to / when onboarding_step_completed >= 3', async () => {
|
||||
it('redirects to /home when onboarding_step_completed >= 3', async () => {
|
||||
useAuthStore.setState({
|
||||
user: makeUser({ onboarding_step_completed: 3 }),
|
||||
})
|
||||
@@ -110,7 +110,7 @@ describe('WelcomeRouter', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('redirects to / when onboarding_dismissed is true', async () => {
|
||||
it('redirects to /home when onboarding_dismissed is true', async () => {
|
||||
useAuthStore.setState({
|
||||
user: makeUser({
|
||||
onboarding_step_completed: 1,
|
||||
|
||||
@@ -65,7 +65,7 @@ function renderPage() {
|
||||
<Routes>
|
||||
<Route path="/welcome/step-1" element={<WelcomeStep1 />} />
|
||||
<Route path="/welcome/step-2" element={<div>step-2</div>} />
|
||||
<Route path="/" element={<div>dashboard</div>} />
|
||||
<Route path="/home" element={<div>dashboard</div>} />
|
||||
</Routes>
|
||||
</MemoryRouter>,
|
||||
)
|
||||
@@ -148,7 +148,7 @@ describe('WelcomeStep1', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('Skip-the-rest dismisses and navigates to /', async () => {
|
||||
it('Skip-the-rest dismisses and navigates to /home', async () => {
|
||||
const user = userEvent.setup()
|
||||
renderPage()
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ function renderPage() {
|
||||
<Route path="/welcome/step-2" element={<WelcomeStep2 />} />
|
||||
<Route path="/welcome/step-3" element={<div>step-3</div>} />
|
||||
<Route path="/account/integrations" element={<div>integrations</div>} />
|
||||
<Route path="/" element={<div>dashboard</div>} />
|
||||
<Route path="/home" element={<div>dashboard</div>} />
|
||||
</Routes>
|
||||
</MemoryRouter>,
|
||||
)
|
||||
@@ -158,7 +158,7 @@ describe('WelcomeStep2', () => {
|
||||
expect(screen.queryByTestId('welcome-step-2-connect-now')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('Skip-the-rest dismisses and navigates to /', async () => {
|
||||
it('Skip-the-rest dismisses and navigates to /home', async () => {
|
||||
const user = userEvent.setup()
|
||||
renderPage()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user