beadboard/tests/components/shared/mobile-nav.test.tsx
zenchantlive fbfe393f6d chore: checkpoint related UI improvements and supporting components
Various supporting changes made during the assign archetypes feature development:

- Added contextual-right-panel.tsx and swarm-command-feed.tsx
- Updated activity-panel.tsx with new features
- UI improvements to left-panel, mobile-nav
- Test updates for url-state-integration, mobile-nav, top-bar
- Package.json updates for dependencies
- Global CSS refinements

These changes support the main assign archetypes feature but are
not directly part of its core functionality.
2026-02-24 16:25:45 -08:00

69 lines
2.3 KiB
TypeScript

import { describe, it } from 'node:test';
import assert from 'node:assert';
describe('Mobile Navigation - Hamburger Menu', () => {
it('exports MobileNav component', async () => {
try {
const mod = await import('../../../src/components/shared/mobile-nav');
assert.ok(mod.MobileNav, 'MobileNav should be exported');
} catch (err: any) {
assert.fail(`MobileNav module should exist: ${err.message}`);
}
});
it('renders tab buttons: Social, Graph', async () => {
try {
const mod = await import('../../../src/components/shared/mobile-nav');
assert.ok(mod.MobileNav, 'MobileNav should exist');
} catch (err: any) {
assert.fail(`MobileNav should render three tabs: ${err.message}`);
}
});
it('highlights active tab with accent color', async () => {
try {
const mod = await import('../../../src/components/shared/mobile-nav');
assert.ok(mod.MobileNav, 'MobileNav should have active state');
} catch (err: any) {
assert.fail(`MobileNav should highlight active tab: ${err.message}`);
}
});
it('uses setView from useUrlState on tab click', async () => {
try {
const mod = await import('../../../src/components/shared/mobile-nav');
assert.ok(mod.MobileNav, 'MobileNav should integrate with useUrlState');
} catch (err: any) {
assert.fail(`MobileNav should use setView: ${err.message}`);
}
});
});
describe('TopBar Hamburger Menu', () => {
it('shows hamburger button on mobile and tablet', async () => {
try {
const mod = await import('../../../src/components/shared/top-bar');
assert.ok(mod.TopBar, 'TopBar should exist');
} catch (err: any) {
assert.fail(`TopBar should show hamburger on mobile/tablet: ${err.message}`);
}
});
it('hamburger button opens left panel drawer', async () => {
try {
const mod = await import('../../../src/components/shared/top-bar');
assert.ok(mod.TopBar, 'TopBar should exist');
} catch (err: any) {
assert.fail(`Hamburger should toggle left panel: ${err.message}`);
}
});
it('hides hamburger on desktop', async () => {
try {
const mod = await import('../../../src/components/shared/top-bar');
assert.ok(mod.TopBar, 'TopBar should exist');
} catch (err: any) {
assert.fail(`Hamburger should be hidden on desktop: ${err.message}`);
}
});
});