diff --git a/approuter/xs-app.json b/approuter/xs-app.json index 52b08f0a7..a1504cc76 100644 --- a/approuter/xs-app.json +++ b/approuter/xs-app.json @@ -408,7 +408,7 @@ "authenticationType": "none" }, { - "source": "^/build/(breadcrumb-context|catalog|co-completions|concepts|homepage-shelves|kg-stats|mission|my-progress|navigator|repo-catalog|slug-mapping|tag-labels|topics-gallery|topics-tree|topics)(/.*)?(\\?.*)?$", + "source": "^/build/(channels-stats|channels|channel-collections|channel-atlas|breadcrumb-context|catalog|co-completions|concepts|homepage-shelves|kg-stats|mission|my-progress|navigator|repo-catalog|slug-mapping|tag-labels|topics-gallery|topics-tree|topics)(/.*)?(\\?.*)?$", "target": "/build/$1$2$3", "destination": "srv-api", "authenticationType": "none" diff --git a/hugo-apps/src/channels-directory/ChannelsDirectory.hub-band.test.ts b/hugo-apps/src/channels-directory/ChannelsDirectory.hub-band.test.ts new file mode 100644 index 000000000..f4d72b3e7 --- /dev/null +++ b/hugo-apps/src/channels-directory/ChannelsDirectory.hub-band.test.ts @@ -0,0 +1,38 @@ +// @vitest-environment happy-dom +import { describe, it, expect } from 'vitest'; +import { mount } from '@vue/test-utils'; +import ChannelsDirectory from './ChannelsDirectory.vue'; + +describe('ChannelsDirectory — hub band', () => { + const wrapper = () => mount(ChannelsDirectory, { props: { channels: [], collections: [] } }); + + it('renders four hub navigation cards', () => { + const links = wrapper().findAll('.channels-hub-band__cards a'); + expect(links).toHaveLength(4); + }); + + it('card hrefs include atlas, health, and media-diet', () => { + const hrefs = wrapper().findAll('.channels-hub-band__cards a').map((l) => l.attributes('href')); + expect(hrefs).toContain('/channels/atlas/'); + expect(hrefs).toContain('/channels/health/'); + expect(hrefs).toContain('/channels/media-diet/'); + }); + + it('hub band appears in DOM before the filter controls', () => { + const html = wrapper().html(); + const hubPos = html.indexOf('channels-hub-band'); + const ctrlPos = html.indexOf('channels-directory__controls'); + expect(hubPos).toBeGreaterThan(-1); + expect(hubPos).toBeLessThan(ctrlPos); + }); + + it('each card has a title and an icon name', () => { + const cards = wrapper().findAll('.channels-hub-band__cards li'); + expect(cards).toHaveLength(4); + for (const card of cards) { + expect(card.find('.hub-card__title').text()).toBeTruthy(); + const icon = card.find('ui5-icon'); + expect(icon.attributes('name')).toBeTruthy(); + } + }); +}); diff --git a/hugo-apps/src/channels-directory/ChannelsDirectory.vue b/hugo-apps/src/channels-directory/ChannelsDirectory.vue index e3e91392c..a70d64c8e 100644 --- a/hugo-apps/src/channels-directory/ChannelsDirectory.vue +++ b/hugo-apps/src/channels-directory/ChannelsDirectory.vue @@ -29,6 +29,43 @@ const cols = computed(() => visibleCollections(props.collections));