From 7fb0ea974155a8dbc95ea4a37656570ef048fead Mon Sep 17 00:00:00 2001 From: Thomas Jung Date: Sat, 5 Sep 2026 17:07:15 -0400 Subject: [PATCH 1/8] feat(channels): add hub band with four navigation cards to /channels/ page --- .../ChannelsDirectory.hub-band.test.ts | 38 +++++++++ .../channels-directory/ChannelsDirectory.vue | 85 +++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 hugo-apps/src/channels-directory/ChannelsDirectory.hub-band.test.ts 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));