Update homepage routes to include language and mode
Build & Deploy / Build & Push Docker Image (push) Successful in 2m51s
Test / Type Check (all packages) (push) Successful in 52s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 39s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 1m0s
Build & Deploy / Build & Push Docker Image (push) Successful in 2m51s
Test / Type Check (all packages) (push) Successful in 52s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 39s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 1m0s
This commit is contained in:
@@ -6,14 +6,14 @@ for (const scenario of [
|
||||
{ locale: 'ar', dir: 'rtl', title: /RentalDriveGo/ },
|
||||
] as const) {
|
||||
test(`${scenario.locale} shell is server rendered`, async ({ page, request }) => {
|
||||
const raw = await request.get(`/${scenario.locale}`);
|
||||
const raw = await request.get(`/${scenario.locale}/system`);
|
||||
const html = await raw.text();
|
||||
expect(raw.status()).toBe(200);
|
||||
expect(html).toMatch(
|
||||
new RegExp(`<html[^>]*lang=\"${scenario.locale}\"[^>]*dir=\"${scenario.dir}\"`),
|
||||
);
|
||||
|
||||
const response = await page.goto(`/${scenario.locale}`);
|
||||
const response = await page.goto(`/${scenario.locale}/system`);
|
||||
expect(response?.status()).toBe(200);
|
||||
await expect(page.locator('html')).toHaveAttribute('lang', scenario.locale);
|
||||
await expect(page.locator('html')).toHaveAttribute('dir', scenario.dir);
|
||||
@@ -23,7 +23,7 @@ for (const scenario of [
|
||||
await expect(page.locator('footer')).toBeVisible();
|
||||
await expect(page.locator('link[rel="canonical"]')).toHaveAttribute(
|
||||
'href',
|
||||
new RegExp(`/${scenario.locale}$`),
|
||||
new RegExp(`/${scenario.locale}/system$`),
|
||||
);
|
||||
for (const language of ['en', 'fr', 'ar', 'x-default']) {
|
||||
await expect(page.locator(`link[rel="alternate"][hreflang="${language}"]`)).toHaveCount(1);
|
||||
@@ -41,18 +41,18 @@ test('root locale detection honors Accept-Language', async ({ browser }) => {
|
||||
});
|
||||
const page = await context.newPage();
|
||||
await page.goto('/');
|
||||
await expect(page).toHaveURL(/\/ar$/);
|
||||
await expect(page).toHaveURL(/\/ar\/system$/);
|
||||
await context.close();
|
||||
});
|
||||
|
||||
test('locale switching keeps the semantic route and approved campaign state', async ({ page }) => {
|
||||
await page.goto('/en/privacy?utm_source=qa&email=drop-me#ignored');
|
||||
await page.goto('/en/system/privacy?utm_source=qa&email=drop-me#ignored');
|
||||
await page.getByLabel('Language').first().selectOption('fr');
|
||||
await expect(page).toHaveURL('/fr/confidentialite?utm_source=qa');
|
||||
await expect(page).toHaveURL('/fr/system/confidentialite?utm_source=qa');
|
||||
});
|
||||
|
||||
test('pending route shells are localized and noindex', async ({ page }) => {
|
||||
await page.goto('/fr/confidentialite');
|
||||
await page.goto('/fr/system/confidentialite');
|
||||
await expect(page.locator('h1')).toContainText('Confidentialité');
|
||||
await expect(page.locator('meta[name="robots"]')).toHaveAttribute('content', /noindex/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user