summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Emanuele Stoppa <my.burning@gmail.com> 2023-11-20 14:11:26 -0600
committerGravatar GitHub <noreply@github.com> 2023-11-20 14:11:26 -0600
commit7ab5137ba724781e8264a33f69ae65020c6549f0 (patch)
treeff34497e7fe3622e655224d6034364f3cc85d475
parent7742fd7dc26533c6f7cd497b00b72de935c57628 (diff)
downloadastro-7ab5137ba724781e8264a33f69ae65020c6549f0.tar.gz
astro-7ab5137ba724781e8264a33f69ae65020c6549f0.tar.zst
astro-7ab5137ba724781e8264a33f69ae65020c6549f0.zip
fix: test case for #9095 (#9127)
-rw-r--r--packages/astro/test/i18n-routing.test.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/astro/test/i18n-routing.test.js b/packages/astro/test/i18n-routing.test.js
index c48adc030..4ec355a81 100644
--- a/packages/astro/test/i18n-routing.test.js
+++ b/packages/astro/test/i18n-routing.test.js
@@ -674,6 +674,37 @@ describe('[SSG] i18n routing', () => {
expect(html).to.include('url=/new-site/en/start');
});
});
+
+ describe('i18n routing with fallback and redirect', () => {
+ /** @type {import('./test-utils').Fixture} */
+ let fixture;
+
+ before(async () => {
+ fixture = await loadFixture({
+ root: './fixtures/i18n-routing-fallback/',
+ redirects: {
+ '/': '/en',
+ },
+ experimental: {
+ i18n: {
+ defaultLocale: 'en',
+ locales: ['en', 'pt', 'it'],
+ fallback: {
+ it: 'en',
+ },
+ },
+ },
+ });
+ await fixture.build();
+ });
+
+ it('should render the en locale', async () => {
+ let html = await fixture.readFile('/index.html');
+ let $ = cheerio.load(html);
+ expect(html).to.include('http-equiv="refresh');
+ expect(html).to.include('Redirecting to: /en');
+ });
+ });
});
describe('[SSR] i18n routing', () => {
let app;