feat: add MobileNav, SidebarNav, and UtilityBar widgets

TDD implementation of three navigation widgets: mobile overlay toggle,
fixed sidebar with IntersectionObserver-driven active section tracking,
and utility bar with contact info and CV download action.
This commit is contained in:
Ilia Mashkov
2026-04-19 08:40:08 +03:00
parent 590147adb1
commit cfe50069b7
7 changed files with 346 additions and 0 deletions
@@ -0,0 +1,30 @@
import { describe, it, expect } from 'vitest'
import { render, screen } from '@testing-library/react'
import { UtilityBar } from './UtilityBar'
describe('UtilityBar', () => {
describe('rendering', () => {
it('renders "Contact" label', () => {
render(<UtilityBar />)
expect(screen.getByText('Contact')).toBeInTheDocument()
})
it('renders email link with correct href', () => {
render(<UtilityBar />)
const link = screen.getByRole('link', { name: 'hello@allmy.work' })
expect(link).toBeInTheDocument()
expect(link).toHaveAttribute('href', 'mailto:hello@allmy.work')
})
it('renders "Download CV" button', () => {
render(<UtilityBar />)
expect(screen.getByRole('button', { name: /download cv/i })).toBeInTheDocument()
})
it('Download CV button has primary variant class', () => {
render(<UtilityBar />)
const btn = screen.getByRole('button', { name: /download cv/i })
expect(btn).toHaveClass('bg-burnt-oxide')
})
})
})