-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(*): Fix cleanup effect is prevent normal navigate (#119)
* Fix cleanup effect is prevent normal navigate * fix with changeset * remove console.log
- Loading branch information
Showing
16 changed files
with
313 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
'@use-funnel/react-navigation-native': patch | ||
'@use-funnel/react-router-dom': patch | ||
'@use-funnel/react-router': patch | ||
'@use-funnel/browser': patch | ||
'@use-funnel/next': patch | ||
--- | ||
|
||
Fix cleanup effect is prevent normal navigate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
|
||
export default function Header() { | ||
return <div style={{ border: '1px solid blue', padding: '10px', backgroundColor: 'lightgray' }}>Header</div>; | ||
return ( | ||
<div style={{ border: '1px solid blue', padding: '10px', backgroundColor: 'lightgray' }}> | ||
<Link href="/">Home</Link> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { expect, test } from '@playwright/test'; | ||
|
||
const APP_ROUTER_LOCAL_URL = 'http://localhost:3100/'; | ||
|
||
test('can move the steps of the funnel using history.push.', async ({ page }) => { | ||
await page.goto(APP_ROUTER_LOCAL_URL); | ||
|
||
await expect(page.getByText('start')).toBeVisible(); | ||
await page.getByRole('link', { name: 'Go to Funnel' }).click(); | ||
|
||
await expect(page.getByText('MAIN - START')).toBeVisible(); | ||
await expect(page.getByText('Sub Start')).toBeVisible(); | ||
|
||
await expect(page.getByRole('button', { name: 'next' })).toBeVisible(); | ||
|
||
await page.getByRole('button', { name: 'next' }).click(); | ||
|
||
await expect(page.getByText('end')).toBeVisible(); | ||
await expect(page.getByText('Sub End')).toBeVisible(); | ||
|
||
await page.getByRole('button', { name: 'next' }).click(); | ||
|
||
await expect(page.getByText('MAIN - END')).toBeVisible(); | ||
|
||
await page.goBack(); | ||
|
||
await expect(page.getByText('start')).toBeVisible(); | ||
await expect(page.getByText('Sub End')).toBeVisible(); | ||
}); | ||
|
||
test('can move the steps of the funnel using Link.', async ({ page }) => { | ||
await page.goto(APP_ROUTER_LOCAL_URL); | ||
|
||
await page.getByRole('link', { name: 'Go to Funnel' }).click(); | ||
|
||
await expect(page.getByText('MAIN - START')).toBeVisible(); | ||
await expect(page.getByText('Sub Start')).toBeVisible(); | ||
|
||
await page.getByRole('link', { name: 'Home' }).click(); | ||
|
||
await expect(page.getByRole('link', { name: 'Go to Funnel' })).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Home() { | ||
return <h1>Home</h1>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.