Skip to content
Closed
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
14 changes: 14 additions & 0 deletions apps/website/src/components/workshop/ModelsCatalogue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ describe('ModelsCatalogue', () => {
).toBeNull()
})

// The line under the title belongs to the half that is open, so the eyebrow
// is what has to hold still: it names the whole catalogue, not the tab.
it('names the Hub in the eyebrow on every tab', async () => {
const user = userEvent.setup()
render(ModelsCatalogue, { props: { models: launchModels } })

const hero = () => screen.getByTestId('workshop-hero')
expect(hero()).toHaveTextContent('Hub')

await user.click(screen.getByRole('button', { name: 'Workflows' }))
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
await screen.findByRole('heading', { name: 'Create product photos & ads' })
expect(hero()).toHaveTextContent('Hub')
})

it('opens the workflow tab from its return link and filters by its own categories', async () => {
history.replaceState(null, '', '/models/?type=workflows')
const user = userEvent.setup()
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/components/workshop/ModelsCatalogue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ watch(
<template>
<WorkshopHero
v-if="!inSection"
:eyebrow="t('workshop.hero.eyebrow', locale)"
:eyebrow="t('workshop.catalogue.eyebrow', locale)"
:heading="t('workshop.hero.heading', locale)"
:subtitle="
t(
Expand Down
1 change: 1 addition & 0 deletions apps/website/src/i18n/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const translations = {
},
'workshop.hero.eyebrow': { en: 'Models', 'zh-CN': '模型' },
'workshop.catalogue.apps': { en: 'Apps', 'zh-CN': '应用' },
'workshop.catalogue.eyebrow': { en: 'Hub', 'zh-CN': 'Hub' },
'workshop.catalogue.categories': { en: 'Categories', 'zh-CN': '分类' },
'workshop.catalogue.show': { en: 'Browse', 'zh-CN': '浏览' },
'workshop.catalogue.subtitle': {
Expand Down
Loading