1
0
mirror of synced 2025-12-21 19:06:49 -05:00

Link to product landing page with language prefix (#46068)

This commit is contained in:
Peter Bengtsson
2023-11-13 15:52:49 -05:00
committed by GitHub
parent c0f94e0f85
commit ac282b8340
2 changed files with 4 additions and 2 deletions

View File

@@ -7,7 +7,9 @@ describe('sidebar', () => {
describe('nav', () => {
test('top level product mentioned at top of sidebar', async () => {
const $ = await getDOM('/get-started')
expect($('[data-testid="sidebar-product-xl"]').text()).toBe('Get started')
const sidebarProduct = $('[data-testid="sidebar-product-xl"]')
expect(sidebarProduct.text()).toBe('Get started')
expect(sidebarProduct.attr('href')).toBe('/en/get-started')
})
test('REST pages get the REST sidebar', async () => {

View File

@@ -34,7 +34,7 @@ export const SidebarNav = ({ variant = 'full' }: Props) => {
<div className="mt-3" id="allproducts-menu">
<Link
data-testid="sidebar-product-xl"
href={currentProduct.href}
href={`/${router.locale}${currentProduct.href}`}
// Note the `_product-title` is used by the popover preview cards
// when it needs this text for in-page links.
className="d-block pl-1 mb-2 h3 color-fg-default no-underline _product-title"