Skip to content

Commit 7ab5137

Browse files
authored
fix: test case for #9095 (#9127)
1 parent 7742fd7 commit 7ab5137

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

packages/astro/test/i18n-routing.test.js

+31
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,37 @@ describe('[SSG] i18n routing', () => {
674674
expect(html).to.include('url=/new-site/en/start');
675675
});
676676
});
677+
678+
describe('i18n routing with fallback and redirect', () => {
679+
/** @type {import('./test-utils').Fixture} */
680+
let fixture;
681+
682+
before(async () => {
683+
fixture = await loadFixture({
684+
root: './fixtures/i18n-routing-fallback/',
685+
redirects: {
686+
'/': '/en',
687+
},
688+
experimental: {
689+
i18n: {
690+
defaultLocale: 'en',
691+
locales: ['en', 'pt', 'it'],
692+
fallback: {
693+
it: 'en',
694+
},
695+
},
696+
},
697+
});
698+
await fixture.build();
699+
});
700+
701+
it('should render the en locale', async () => {
702+
let html = await fixture.readFile('/index.html');
703+
let $ = cheerio.load(html);
704+
expect(html).to.include('http-equiv="refresh');
705+
expect(html).to.include('Redirecting to: /en');
706+
});
707+
});
677708
});
678709
describe('[SSR] i18n routing', () => {
679710
let app;

0 commit comments

Comments
 (0)