Skip to content

Commit 8dc2b3a

Browse files
committed
test: add AppFooter column label regression tests
1 parent 0aa31b1 commit 8dc2b3a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/nuxt/components/AppFooter.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@ import AppFooter from '~/components/AppFooter.vue'
44

55
/* check nuxt module at modules/build-env.ts */
66
describe('AppFooter', () => {
7+
it('renders three labeled columns: Product, Legal, Community', async () => {
8+
const component = await mountSuspended(AppFooter, {
9+
route: '/',
10+
})
11+
12+
// All three column label spans should be present
13+
const columnLabels = component.findAll('span.tracking-wide')
14+
expect(columnLabels.length).toBeGreaterThanOrEqual(3)
15+
16+
const labelTexts = columnLabels.map(span => span.text().toLowerCase())
17+
expect(labelTexts.some(t => t.includes('product'))).toBe(true)
18+
expect(labelTexts.some(t => t.includes('legal'))).toBe(true)
19+
expect(labelTexts.some(t => t.includes('community'))).toBe(true)
20+
})
21+
22+
it('footer contains links expected in the Product column', async () => {
23+
const component = await mountSuspended(AppFooter, {
24+
route: '/about',
25+
})
26+
27+
// The Product column should link to /about and /blog
28+
const aboutLink = component.find('a[href="/about"]')
29+
expect(aboutLink.exists()).toBe(true)
30+
})
31+
732
it('BuildEnvironment is properly displayed at settings', async () => {
833
const buildInfo = useAppConfig().buildInfo
934
const component = await mountSuspended(AppFooter, {

0 commit comments

Comments
 (0)