Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/website/e2e/header-models-navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ for (const { locale, path } of [
}
}

test('Hub menu marks only external links with the arrow', async ({
test('Hub menu apps open in the same tab and only external links carry the arrow', async ({
context,
page
}) => {
Expand All @@ -143,13 +143,13 @@ test('Hub menu marks only external links with the arrow', async ({
name: 'Cinematic Studio',
exact: true
})
await expect(cinematicStudio).toHaveAttribute('target', '_blank')
await expect(cinematicStudio).not.toHaveAttribute('target')
await expect(cinematicStudio.getByTestId('external-link-arrow')).toHaveCount(
0
)

const reshoot = dropdown.getByRole('link', { name: 'Re-shoot', exact: true })
await expect(reshoot).toHaveAttribute('target', '_blank')
await expect(reshoot).not.toHaveAttribute('target')
await expect(reshoot.getByTestId('external-link-arrow')).toHaveCount(0)

await desktopLinks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,11 @@ describe('HeaderMainDesktop', () => {
})

it.for(['Cinematic Studio', 'Re-shoot'])(
'opens the %s app in a tab of its own',
'opens the %s app in the same tab',
async (name) => {
const menu = await openHub()
const link = menu.getByRole('link', { name })

expect(link).toHaveAttribute('target', '_blank')
expect(link).toHaveAttribute('rel', 'noopener')
expect(menu.getByRole('link', { name })).not.toHaveAttribute('target')
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ describe('HeaderMainMobile', () => {
'/hub/apps/reshoot/',
'/hub/apps/'
])
expect(screen.getByRole('link', { name: 'Re-shoot' })).toHaveAttribute(
'target',
'_blank'
expect(screen.getByRole('link', { name: 'Re-shoot' })).not.toHaveAttribute(
'target'
)
expect(screen.getByRole('link', { name: 'All apps' })).not.toHaveAttribute(
'target'
Expand Down
8 changes: 6 additions & 2 deletions apps/website/src/data/mainNavigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,13 @@ describe('getMainNavigation', () => {
{
label: 'Cinematic Studio',
href: '/hub/apps/cinematic-studio/',
newTab: true
newTab: undefined
},
{ label: 'Re-shoot', href: '/hub/apps/reshoot/', newTab: true }
{
label: 'Re-shoot',
href: '/hub/apps/reshoot/',
newTab: undefined
}
],
allLink: { label: 'All apps', href: '/hub/apps/' }
}
Expand Down
6 changes: 2 additions & 4 deletions apps/website/src/data/mainNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,11 @@ export function getMainNavigation(
items: [
{
label: t('nav.cinematicStudio'),
href: routes.cinematicStudio,
newTab: true
href: routes.cinematicStudio
},
...when(hubSections.reshoot, {
label: t('nav.reshoot'),
href: routes.reshoot,
newTab: true
href: routes.reshoot
})
],
allLink: { label: t('nav.hubAllApps'), href: routes.hubApps }
Expand Down
Loading