The menu shows only Connect while signed out and the section links once signed in; / goes to Connect or Identities accordingly. Yes/no settings in the engine forms put the box beside its text. The Secrets page now has New secrets engine on its own line, then a labelled engine picker with Settings and Delete beside it, then the breadcrumbs, and dynamic engines use the full width. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { render, screen } from '@testing-library/react'
|
|
import { createMemoryRouter, RouterProvider } from 'react-router'
|
|
import { expect, test } from 'vitest'
|
|
import { SessionProvider } from './api/session'
|
|
import { Providers } from './test/providers'
|
|
import { routes } from './routes'
|
|
|
|
test.each([
|
|
['/identities', 'Identities'],
|
|
['/secrets', 'Secrets'],
|
|
['/graph', 'Access Graph'],
|
|
['/connect', 'Connect'],
|
|
])('renders %s', (path, heading) => {
|
|
const router = createMemoryRouter(routes, { initialEntries: [path] })
|
|
render(
|
|
<Providers>
|
|
<SessionProvider>
|
|
<RouterProvider router={router} />
|
|
</SessionProvider>
|
|
</Providers>,
|
|
)
|
|
expect(screen.getByRole('heading', { name: heading })).toBeInTheDocument()
|
|
})
|
|
|
|
test('redirects / to the connect page while signed out', () => {
|
|
const router = createMemoryRouter(routes, { initialEntries: ['/'] })
|
|
render(
|
|
<Providers>
|
|
<SessionProvider>
|
|
<RouterProvider router={router} />
|
|
</SessionProvider>
|
|
</Providers>,
|
|
)
|
|
expect(screen.getByRole('heading', { name: 'Connect' })).toBeInTheDocument()
|
|
expect(router.state.location.pathname).toBe('/connect')
|
|
})
|