Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(head): apply baseURL to head composable (#2912)
Co-authored-by: Bobbie Goede <bobbiegoede@gmail.com>
- Loading branch information
1 parent
60396c6
commit 6dcbfbb
Showing
2 changed files
with
28 additions
and
3 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,23 @@ | ||
import { test, expect, describe } from 'vitest' | ||
import { fileURLToPath } from 'node:url' | ||
import { URL } from 'node:url' | ||
import { setup } from '../utils' | ||
import { renderPage } from '../helper' | ||
|
||
describe('#2911', async () => { | ||
await setup({ | ||
rootDir: fileURLToPath(new URL(`../fixtures/basic`, import.meta.url)), | ||
browser: true, | ||
nuxtConfig: { | ||
app: { | ||
baseURL: '/base-path' | ||
} | ||
} | ||
}) | ||
|
||
test('`useLocaleHead` uses Nuxt `app.baseURL` in meta tags', async () => { | ||
const { page } = await renderPage('/base-path') | ||
|
||
expect(await page.locator('head #i18n-alt-en').getAttribute('href')).toMatch(/\/base-path$/) | ||
}) | ||
}) |
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