0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

fix: test case for #9095 (#9127)

This commit is contained in:
Emanuele Stoppa 2023-11-20 14:11:26 -06:00 committed by GitHub
parent 7742fd7dc2
commit 7ab5137ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;