summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/test/i18n-routing.test.js11
-rw-r--r--packages/integrations/sitemap/test/fixtures/static/src/pages/endpoint.json.ts10
2 files changed, 14 insertions, 7 deletions
diff --git a/packages/astro/test/i18n-routing.test.js b/packages/astro/test/i18n-routing.test.js
index b9fca7731..f074cbb24 100644
--- a/packages/astro/test/i18n-routing.test.js
+++ b/packages/astro/test/i18n-routing.test.js
@@ -750,12 +750,18 @@ describe('[SSG] i18n routing', () => {
let $ = cheerio.load(html);
expect(html).to.include('http-equiv="refresh');
expect(html).to.include('url=/new-site/start');
+ html = await fixture.readFile('/spanish/index.html');
+ expect(html).to.include('http-equiv="refresh');
+ expect(html).to.include('url=/new-site');
});
it('should redirect to the english locale, which is the first fallback', async () => {
- const html = await fixture.readFile('/it/start/index.html');
+ let html = await fixture.readFile('/it/start/index.html');
expect(html).to.include('http-equiv="refresh');
expect(html).to.include('url=/new-site/start');
+ html = await fixture.readFile('/it/index.html');
+ expect(html).to.include('http-equiv="refresh');
+ expect(html).to.include('url=/new-site');
});
it("should render a 404 because the route `fr` isn't included in the list of locales of the configuration", async () => {
@@ -803,6 +809,9 @@ describe('[SSG] i18n routing', () => {
let html = await fixture.readFile('/it/start/index.html');
expect(html).to.include('http-equiv="refresh');
expect(html).to.include('url=/new-site/en/start');
+ html = await fixture.readFile('/it/index.html');
+ expect(html).to.include('http-equiv="refresh');
+ expect(html).to.include('url=/new-site/en');
});
});
diff --git a/packages/integrations/sitemap/test/fixtures/static/src/pages/endpoint.json.ts b/packages/integrations/sitemap/test/fixtures/static/src/pages/endpoint.json.ts
index 4b848f339..2e088376f 100644
--- a/packages/integrations/sitemap/test/fixtures/static/src/pages/endpoint.json.ts
+++ b/packages/integrations/sitemap/test/fixtures/static/src/pages/endpoint.json.ts
@@ -1,8 +1,6 @@
export async function GET({}) {
- return {
- body: JSON.stringify({
- name: 'Astro',
- url: 'https://astro.build/',
- }),
- };
+ return Response.json({
+ name: 'Astro',
+ url: 'https://astro.build/',
+ });
}