Skip to content
Open
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
6 changes: 1 addition & 5 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ export default function Header() {
<div className="max-w-6xl mx-auto px-4 sm:px-6 flex items-center justify-between h-16">
<Link
href="/"
className="flex items-center gap-2 font-bold text-lg text-indigo-600 dark:text-indigo-400"
className="font-bold text-lg text-indigo-600 dark:text-indigo-400"
aria-label="BuyWhere Home"
aria-current={isHome ? "page" : undefined}
>
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<rect width="28" height="28" rx="6" fill="#4f46e5" />
<path d="M7 10h14M7 14h10M7 18h12" stroke="white" strokeWidth="2" strokeLinecap="round" />
</svg>
<span>BuyWhere</span>
</Link>

Expand Down
6 changes: 1 addition & 5 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ export default function Nav() {
return (
<header className="sticky top-0 z-50 bg-white/90 backdrop-blur border-b border-gray-100">
<div className="max-w-6xl mx-auto px-4 sm:px-6 flex items-center justify-between h-16">
<Link href="/" className="flex items-center gap-2 font-bold text-lg text-indigo-600" aria-label="BuyWhere Home">
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<rect width="28" height="28" rx="6" fill="#4f46e5" />
<path d="M7 10h14M7 14h10M7 18h12" stroke="white" strokeWidth="2" strokeLinecap="round" />
</svg>
<Link href="/" className="font-bold text-lg text-indigo-600" aria-label="BuyWhere Home">
<span>BuyWhere</span>
</Link>

Expand Down
19 changes: 19 additions & 0 deletions tests/e2e/site-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ test.describe('Homepage', () => {
await expect(nav).toBeVisible();
});


for (const viewport of [
{ name: 'mobile', width: 390, height: 844 },
{ name: 'tablet', width: 768, height: 1024 },
]) {
test(`shows one menu icon and a plain brand on ${viewport.name}`, async ({ page }) => {
await page.setViewportSize(viewport);
await page.goto('/');

const brand = page.getByRole('link', { name: 'BuyWhere Home' });
await expect(brand).toBeVisible();
await expect(brand.locator('svg')).toHaveCount(0);

const menu = page.getByRole('button', { name: 'Open menu' });
await expect(menu).toBeVisible();
await expect(menu).toHaveCount(1);
});
}

test('has no broken meta charset or viewport', async ({ page }) => {
await page.goto('/');
const title = await page.title();
Expand Down