-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24345 from storybookjs/norbert/fix-24292
ManagerAPI: Fix bug with story redirection when URL has partial storyId (cherry picked from commit a1963a3)
- Loading branch information
1 parent
79b8da5
commit 35c28d7
Showing
3 changed files
with
31 additions
and
6 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,18 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import process from 'process'; | ||
import { SbPage } from './util'; | ||
|
||
const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:8001'; | ||
|
||
test.describe('navigating', () => { | ||
test('a URL with a partial storyId will redirect to the first story', async ({ page }) => { | ||
// this is purposefully not using the SbPage class, and the URL is a partial (it does not contain the full storyId) | ||
await page.goto(`${storybookUrl}?path=/story/example-button`); | ||
|
||
const sbPage = new SbPage(page); | ||
|
||
await sbPage.waitUntilLoaded(); | ||
|
||
await expect(sbPage.page.url()).toContain('/docs/example-button--docs'); | ||
}); | ||
}); |
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