✅(e2e) check lang attribute on html tag updates
Asserts that lang attribute of html tag updates according to language chosen by user.
This commit is contained in:
committed by
Sebastien Nobour
parent
dfb5394310
commit
d3589dfca1
@@ -26,4 +26,20 @@ test.describe('Language', () => {
|
|||||||
}),
|
}),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// test('checks lang attribute of html tag has same default value as defined');
|
||||||
|
test('checks lang attribute of html tag updates when user changes language', async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
const header = page.locator('header').first();
|
||||||
|
|
||||||
|
await header.getByRole('combobox').getByText('EN').click();
|
||||||
|
const html = page.locator('html');
|
||||||
|
|
||||||
|
await expect(html).toHaveAttribute('lang', 'en');
|
||||||
|
|
||||||
|
await header.getByRole('option', { name: 'FR' }).click();
|
||||||
|
|
||||||
|
await expect(html).toHaveAttribute('lang', 'fr');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user