diff --git a/src/modules/self-operated/components/DashboardCharts.test.ts b/src/modules/self-operated/components/DashboardCharts.test.ts index 06d82946..ec78ee0d 100644 --- a/src/modules/self-operated/components/DashboardCharts.test.ts +++ b/src/modules/self-operated/components/DashboardCharts.test.ts @@ -10,6 +10,17 @@ function point(date: string, value: number | null, dataStatus = 'COMPLETE'): Dai return { businessDate: date, outboundQuantity: dataStatus === 'COMPLETE' ? value : null, observedQuantity: value, dataStatus, reasonCodes: [], quantityUnit: 'PCS' } } describe('dashboard chart integrity and interaction', () => { + it('keeps dates and line explanations behind the description action', async () => { + const wrapper = mount(DashboardTrend, { props: { points: [point('2026-10-01', 2)] }, slots: { explanation: '

统计日期示例

' } }) + expect(wrapper.text()).not.toContain('统计日期示例') + expect(wrapper.text()).not.toContain('实线/实心点') + await wrapper.findAll('button').find(button => button.text() === '说明')!.trigger('click') + expect(wrapper.text()).toContain('统计日期示例') + expect(wrapper.text()).toContain('实线/实心点') + await wrapper.setProps({ points: [point('2026-10-02', 3)] }) + expect(wrapper.find('[role=dialog]').exists()).toBe(false) + wrapper.unmount() + }) it('fills only contiguous known segments and keeps unknown days unavailable for drilldown', async () => { const wrapper = mount(DashboardTrend, { props: { points: [point('2026-10-01', 2), point('2026-10-02', 4), point('2026-10-03', null, 'UNKNOWN'), point('2026-10-04', 1, 'PARTIAL')] } }) const chart = wrapper.findComponent({ name: 'VChart' }) diff --git a/src/modules/self-operated/components/DashboardTrend.vue b/src/modules/self-operated/components/DashboardTrend.vue index 3360c2eb..41fae0d3 100644 --- a/src/modules/self-operated/components/DashboardTrend.vue +++ b/src/modules/self-operated/components/DashboardTrend.vue @@ -19,10 +19,12 @@ function selectChart(event: ECElementEvent) { const point = props.points[event.d