minor: new nav system (#5)
All checks were successful
ci/woodpecker/push/push Pipeline was successful

Co-authored-by: Madison Grubb <madison@elastiflow.com>
Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
2026-02-15 04:04:54 +00:00
parent 9261ba92bf
commit 0aab29ea72
27 changed files with 1198 additions and 688 deletions

View File

@@ -23,7 +23,7 @@ test.describe('Live Streaming E2E', () => {
await loginAsAdmin(page, TEST_ADMIN.identifier, TEST_ADMIN.password)
await page.goto('/cameras')
await page.waitForLoadState('domcontentloaded')
await expect(page.getByRole('heading', { name: 'Cameras' })).toBeVisible({ timeout: 10000 })
await expect(page.getByRole('heading', { name: 'Cameras', exact: true })).toBeVisible({ timeout: 10000 })
})
test('publisher only: start sharing and reach Live', async ({ browser, browserName }) => {

View File

@@ -3,7 +3,7 @@ import { mountSuspended, registerEndpoint } from '@nuxt/test-utils/runtime'
import NavDrawer from '../../app/components/NavDrawer.vue'
const withAuth = () => {
registerEndpoint('/api/me', () => ({ id: '1', identifier: 'user', role: 'member' }), { method: 'GET' })
registerEndpoint('/api/me', () => ({ id: '1', identifier: 'user', role: 'member', avatar_url: null }), { method: 'GET' })
}
describe('NavDrawer', () => {
@@ -32,7 +32,6 @@ describe('NavDrawer', () => {
})
expect(document.body.textContent).toContain('Map')
expect(document.body.textContent).toContain('Settings')
expect(document.body.textContent).toContain('Navigation')
})
it('emits update:modelValue when close is triggered', async () => {

View File

@@ -4,7 +4,7 @@ import DefaultLayout from '../../app/layouts/default.vue'
import NavDrawer from '../../app/components/NavDrawer.vue'
const withAuth = () => {
registerEndpoint('/api/me', () => ({ id: '1', identifier: 'user', role: 'member' }), { method: 'GET' })
registerEndpoint('/api/me', () => ({ id: '1', identifier: 'user', role: 'member', avatar_url: null }), { method: 'GET' })
}
describe('default layout', () => {
@@ -12,10 +12,9 @@ describe('default layout', () => {
withAuth()
const wrapper = await mountSuspended(DefaultLayout)
expect(wrapper.text()).toContain('KestrelOS')
expect(wrapper.text()).toContain('Tactical Operations Center')
})
it('renders drawer toggle with accessible label', async () => {
it('renders drawer toggle with accessible label on mobile', async () => {
withAuth()
const wrapper = await mountSuspended(DefaultLayout)
const toggle = wrapper.find('button[aria-label="Toggle navigation"]')
@@ -28,14 +27,19 @@ describe('default layout', () => {
expect(wrapper.findComponent(NavDrawer).exists()).toBe(true)
})
it('calls logout and navigates when Logout is clicked', async () => {
it('renders user menu and sign out navigates home', async () => {
withAuth()
registerEndpoint('/api/auth/logout', () => null, { method: 'POST' })
const wrapper = await mountSuspended(DefaultLayout)
await new Promise(r => setTimeout(r, 100))
const logoutBtn = wrapper.findAll('button').find(b => b.text().includes('Logout'))
expect(logoutBtn).toBeDefined()
await logoutBtn.trigger('click')
const menuTrigger = wrapper.find('button[aria-label="User menu"]')
expect(menuTrigger.exists()).toBe(true)
await menuTrigger.trigger('click')
await new Promise(r => setTimeout(r, 50))
const signOut = wrapper.find('button[role="menuitem"]')
expect(signOut.exists()).toBe(true)
expect(signOut.text()).toContain('Sign out')
await signOut.trigger('click')
await new Promise(r => setTimeout(r, 100))
const router = useRouter()
await router.isReady()