Skip to content
Merged
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
24 changes: 17 additions & 7 deletions src/components/layout/AppLayout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ beforeEach(() => {
vi.fn((input: RequestInfo | URL) => {
const url = requestUrl(input)
return Promise.resolve(
jsonResponse(url.includes('/notifications') ? EMPTY_NOTIFICATION_RESPONSE : EMPTY_TODAY_RESPONSE),
jsonResponse(
url.includes('/notifications') ? EMPTY_NOTIFICATION_RESPONSE : EMPTY_TODAY_RESPONSE,
),
)
}),
)
Expand All @@ -82,15 +84,15 @@ afterEach(() => {
})

describe('AppLayout', () => {
it('renders the current global navigation without a workers tab', () => {
it('renders the current global navigation including the workers tab', () => {
localStorage.setItem('fowoco.onboarding.completed', 'true')
renderLayout()

expect(screen.getByText('FOWOCO')).toBeInTheDocument()
for (const item of NAV_ITEMS) {
expect(screen.getByRole('link', { name: item.label })).toBeInTheDocument()
}
expect(screen.queryByRole('link', { name: '근로자' })).not.toBeInTheDocument()
expect(screen.getByRole('link', { name: '근로자' })).toHaveAttribute('href', '/workers')
})

it('shows server-backed work shortcut counts and routes them to focused inbox views', async () => {
Expand Down Expand Up @@ -169,7 +171,9 @@ describe('AppLayout', () => {
it('shows the onboarding tour automatically on first visit', () => {
renderLayout()

expect(screen.getByRole('dialog', { name: 'FOWOCO에 오신 것을 환영합니다' })).toBeInTheDocument()
expect(
screen.getByRole('dialog', { name: 'FOWOCO에 오신 것을 환영합니다' }),
).toBeInTheDocument()
})

it('does not show the onboarding tour again once completed', () => {
Expand All @@ -184,10 +188,14 @@ describe('AppLayout', () => {
renderLayout()

await user.click(screen.getByRole('button', { name: '다음' }))
expect(screen.getByRole('dialog', { name: 'Today·업무함에서 우선순위를 확인하세요' })).toBeInTheDocument()
expect(
screen.getByRole('dialog', { name: 'Today·업무함에서 우선순위를 확인하세요' }),
).toBeInTheDocument()

await user.click(screen.getByRole('button', { name: '다음' }))
expect(screen.getByRole('dialog', { name: '무엇이든 요청하면 Agent가 초안을 준비합니다' })).toBeInTheDocument()
expect(
screen.getByRole('dialog', { name: '무엇이든 요청하면 Agent가 초안을 준비합니다' }),
).toBeInTheDocument()

await user.click(screen.getByRole('button', { name: '시작하기' }))

Expand Down Expand Up @@ -215,6 +223,8 @@ describe('AppLayout', () => {
await user.click(screen.getByRole('button', { name: '시작 가이드 다시 보기 →' }))

expect(screen.queryByRole('dialog', { name: '도움말' })).not.toBeInTheDocument()
expect(screen.getByRole('dialog', { name: 'FOWOCO에 오신 것을 환영합니다' })).toBeInTheDocument()
expect(
screen.getByRole('dialog', { name: 'FOWOCO에 오신 것을 환영합니다' }),
).toBeInTheDocument()
})
})
4 changes: 2 additions & 2 deletions src/components/layout/navItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import documentsIcon from './nav-icons/documents.svg'
import settingsIcon from './nav-icons/settings.svg'
import todayIcon from './nav-icons/today.svg'
import workIcon from './nav-icons/work.svg'
import workersIcon from './nav-icons/workers.svg'

export interface NavItem {
label: string
to: string
iconSrc: string
}

// 공용 사이드바에는 주요 운영 진입점만 노출한다. 근로자 기능은 업무·문서 흐름에서
// 컨텍스트로 진입하므로 전역 탭에서는 제외하고, 딥링크와 관련 라우트는 유지한다.
// SettingsPage는 제거되어 "설정" 메뉴는 내 프로필 페이지로 연결된다.
export const NAV_ITEMS: NavItem[] = [
{ label: 'Today', to: '/dashboard', iconSrc: todayIcon },
{ label: '업무함', to: '/tasks', iconSrc: workIcon },
{ label: '근로자', to: '/workers', iconSrc: workersIcon },
{ label: '문서함', to: '/documents', iconSrc: documentsIcon },
{ label: 'Agent 기록', to: '/agent', iconSrc: agentIcon },
{ label: '설정', to: '/profile', iconSrc: settingsIcon },
Expand Down