-
-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: locale prefixes are not added to route aliases (#2962)
* fix: locale prefixes are not added to route aliases * refactor: simplify `analyzeNuxtPages` * test: add tests for prefixed alias * refactor: revert unrelated refactor * fix: add warning if `scanPageMeta` is disabled
- Loading branch information
1 parent
d00d368
commit 6223696
Showing
6 changed files
with
116 additions
and
28 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,28 @@ | ||
import { test, expect } from 'vitest' | ||
import { fileURLToPath } from 'node:url' | ||
import { setup, url } from '../utils' | ||
import { getText, renderPage } from '../helper' | ||
|
||
await setup({ | ||
rootDir: fileURLToPath(new URL(`../fixtures/basic_usage`, import.meta.url)), | ||
browser: true, | ||
// overrides | ||
nuxtConfig: { | ||
experimental: { | ||
scanPageMeta: true | ||
} | ||
} | ||
}) | ||
|
||
describe('Using Nuxt experimental feature `scanPageMeta`', async () => { | ||
test('can access localized alias', async () => { | ||
const { page } = await renderPage('/') | ||
|
||
// Aliases path renders home | ||
await page.goto(url('/aliased-home-path')) | ||
expect(await getText(page, 'title')).toEqual('Page - Homepage') | ||
|
||
await page.goto(url('/fr/aliased-home-path')) | ||
expect(await getText(page, 'title')).toEqual('Page - Accueil') | ||
}) | ||
}) |
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