|
|
@@ -133,11 +133,21 @@ describe('FunnelPage — fixed funnel + period selection', () => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- it('shows a terse time-boundary line under the control (date + 不含今日)', async () => {
|
|
|
+ it('date range shows only for rolling periods; nothing for 单日; no 不含今日', async () => {
|
|
|
queryFunnelMock.mockResolvedValue(readyResponse());
|
|
|
+ const user = userEvent.setup();
|
|
|
renderPage();
|
|
|
- // default 单日 → 「2026-06-23 · 不含今日」(精简,无"数据日期"前缀)
|
|
|
- expect(await screen.findByText(/2026-06-23 · 不含今日/)).toBeInTheDocument();
|
|
|
+
|
|
|
+ // default 单日 → 无边界文案
|
|
|
+ await waitFor(() => expect(lastPeriod()).toBe('day'));
|
|
|
+ expect(screen.queryByText(/不含今日/)).not.toBeInTheDocument();
|
|
|
+ expect(screen.queryByText(/~/)).not.toBeInTheDocument();
|
|
|
+
|
|
|
+ // 近 7 天 → 显示日期范围,且无"不含今日"
|
|
|
+ await user.click(screen.getByRole('button', { name: '近 7 天' }));
|
|
|
+ await waitFor(() => expect(lastPeriod()).toBe('last_7d'));
|
|
|
+ expect(screen.getByText(/2026-06-17 ~ 2026-06-23/)).toBeInTheDocument();
|
|
|
+ expect(screen.queryByText(/不含今日/)).not.toBeInTheDocument();
|
|
|
});
|
|
|
|
|
|
/** Open the always-on 单日 calendar popover and return its dialog. */
|