Skip to content

Commit

Permalink
test: merge issue nuxt-modules#2132 test
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed Mar 21, 2024
1 parent 1fb1c89 commit b20468d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 94 deletions.
7 changes: 0 additions & 7 deletions specs/fixtures/issues/2132/app.vue

This file was deleted.

12 changes: 0 additions & 12 deletions specs/fixtures/issues/2132/i18n.config.ts

This file was deleted.

30 changes: 0 additions & 30 deletions specs/fixtures/issues/2132/nuxt.config.ts

This file was deleted.

15 changes: 0 additions & 15 deletions specs/fixtures/issues/2132/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions specs/fixtures/issues/2132/pages/index.vue

This file was deleted.

20 changes: 0 additions & 20 deletions specs/issues/2132.spec.ts

This file was deleted.

25 changes: 24 additions & 1 deletion specs/routing_strategies/prefix.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, test, expect } from 'vitest'
import { fileURLToPath } from 'node:url'
import { setup, url, fetch } from '../utils'
import { getText, getData, renderPage, waitForURL, startServerWithRuntimeConfig } from '../helper'
import { getText, getData, renderPage, waitForURL, startServerWithRuntimeConfig, gotoPath } from '../helper'

import type { Response } from 'playwright'

Expand Down Expand Up @@ -152,4 +152,27 @@ describe('strategy: prefix', async () => {

await restore()
})

test("(#2132) should redirect on root url with `redirectOn: 'no prefix'`", async () => {
const restore = await startServerWithRuntimeConfig({
public: {
i18n: {
detectBrowserLanguage: {
useCookie: true,
cookieSecure: true,
fallbackLocale: 'en',
redirectOn: 'no prefix'
}
}
}
})

const { page } = await renderPage('/', { locale: 'fr' })
expect(await getText(page, '#home-header')).toEqual('Accueil')

await gotoPath(page, '/en')
expect(await getText(page, '#home-header')).toEqual('Homepage')

await restore()
})
})

0 comments on commit b20468d

Please sign in to comment.