Skip to content

Commit

Permalink
fix: test case for #9095 (#9127)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Nov 20, 2023
1 parent 7742fd7 commit 7ab5137
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/astro/test/i18n-routing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7ab5137

Please sign in to comment.