-
-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
defaultDirection
option (#1541)
- Loading branch information
Showing
12 changed files
with
431 additions
and
226 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
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
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,37 @@ | ||
import { test } from 'vitest' | ||
import { fileURLToPath } from 'node:url' | ||
import { setup, $fetch } from '@nuxt/test-utils' | ||
import { getDom, assertLocaleHeadWithDom } from '../helper' | ||
|
||
await setup({ | ||
rootDir: fileURLToPath(new URL(`../fixtures/basic`, import.meta.url)), | ||
browser: true, | ||
// overrides | ||
nuxtConfig: { | ||
i18n: { | ||
defaultLocale: 'en', | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
baseUrl: (nuxt: any) => { | ||
if (process.server) { | ||
const xOverrideBaseUrl = nuxt.ssrContext.req.headers['x-override-base-url'] | ||
console.log('xOverrideBaseUrl', xOverrideBaseUrl) | ||
if (Array.isArray(xOverrideBaseUrl)) { | ||
return xOverrideBaseUrl[0] | ||
} | ||
return xOverrideBaseUrl || '' | ||
} | ||
return '' | ||
} | ||
} | ||
} | ||
}) | ||
|
||
test('render seo tags with baseUrl', async () => { | ||
const html = await $fetch('/?noncanonical', { | ||
headers: { | ||
'X-Override-Base-Url': 'CUSTOM' | ||
} | ||
}) | ||
const dom = getDom(html) | ||
await assertLocaleHeadWithDom(dom, '#home-use-locale-head') | ||
}) |
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.