import { render, screen } from '@testing-library/react'
import PeopleStructureDashboard from './PeopleStructureDashboard'
jest.mock('./DepartmentShell', () => ({
__esModule: true,
default: ({ children }: { children: React.ReactNode }) =>
{children}
,
}))
jest.mock('@/components/organization/OrganizationWorkspace', () => ({
__esModule: true,
default: (props: Record) => (
{String(props.description)}
),
}))
describe('PeopleStructureDashboard', () => {
it('在部门工作台内复用真实组织架构并聚焦品牌中心', () => {
render()
expect(screen.getByTestId('department-shell')).toBeInTheDocument()
expect(screen.getByTestId('organization-workspace')).toHaveAttribute('data-embedded', 'true')
expect(screen.getByTestId('organization-workspace')).toHaveAttribute('data-scope', '品牌中心')
expect(screen.getByTestId('organization-workspace')).toHaveAttribute('data-heading', '人员架构')
expect(screen.getByTestId('organization-workspace')).toHaveAttribute('data-tree-as-secondary-sidebar', 'true')
expect(screen.getByText(/公司组织架构 · 品牌中心在职人员/)).toBeInTheDocument()
})
})