fix: restore carrier reporting status summaries

This commit is contained in:
hectorzhao
2026-09-02 10:27:29 +08:00
parent 9e34757d6f
commit cd824999f3
9 changed files with 58 additions and 28 deletions
@@ -17,7 +17,7 @@ const signature = {
carrierReportSummary: {
mobile: { status: 'approved', approved: 3, total: 3 },
unicom: { status: 'reporting', approved: 2, total: 3 },
telecom: { status: 'waiting_material', approved: 1, total: 3 },
telecom: { status: 'abandoned', approved: 0, total: 3 },
},
drainageInfo: { links: [{ id: 'drainage-1', siteName: 'www.lisglo.com', url: 'www.lisglo.com', auditStatus: 'approved' }] },
drainageCarrierReportSummary: {
@@ -42,15 +42,17 @@ function renderTable(overrides: Partial<Parameters<typeof EnterpriseSignaturesTa
}
describe('EnterpriseSignaturesTable dense presentation', () => {
it('uses compact headers, bracketed signatures, channel counts and only the requested row actions', () => {
it('uses compact headers, bracketed signatures, carrier statuses with counts and only the requested row actions', () => {
renderTable();
expect(screen.getByText('【聆界科技】')).toBeVisible();
expect(screen.getAllByText('审核状态')).toHaveLength(2);
expect(screen.queryByText('签名名称')).not.toBeInTheDocument();
expect(screen.queryByText('签名审核')).not.toBeInTheDocument();
expect(screen.queryByText('报备详情')).not.toBeInTheDocument();
expect(screen.getAllByLabelText('已报备通过3个,总通道数3个')).toHaveLength(2);
expect(screen.getByLabelText('已报备通过2个,总通道数3个')).toHaveTextContent('2/3');
expect(screen.getAllByLabelText('全部通过,已报备通过3个,总通道数3个')).toHaveLength(2);
expect(screen.getByLabelText('部分通过,已报备通过2个,总通道数3个')).toHaveTextContent('部分通过2/3');
expect(screen.getByLabelText('放弃报备,已报备通过0个,总通道数3个')).toHaveTextContent('放弃报备0/3');
expect(screen.getByLabelText('资料待补充,已报备通过0个,总通道数3个')).toHaveTextContent('资料待补充0/3');
expect(screen.getAllByRole('button', { name: '报备状态' })).toHaveLength(2);
expect(screen.getAllByRole('button', { name: '编辑' })).toHaveLength(2);
expect(screen.getAllByRole('button', { name: '删除' })).toHaveLength(2);
@@ -61,5 +63,8 @@ describe('EnterpriseSignaturesTable dense presentation', () => {
renderTable({ expandedSignatureId: '', setSignatureSort });
await userEvent.click(screen.getByRole('button', { name: '签名降序' }));
expect(setSignatureSort).toHaveBeenCalledWith('desc');
expect(screen.getByRole('button', { name: '签名升序' }).querySelector('.lucide-triangle')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '签名降序' }).querySelector('.enterprise-signature-table__sort-triangle--down')).toBeInTheDocument();
expect(document.querySelector('.lucide-arrow-up, .lucide-arrow-down')).not.toBeInTheDocument();
});
});