Skip to content
Open
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
14 changes: 14 additions & 0 deletions packages/jaeger-ui/src/components/TracePage/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,20 @@ describe('<TracePage>', () => {
const spanGraph = screen.queryByTestId('span-graph');
expect(spanGraph).not.toBeInTheDocument();
});

describe('when timeline bars are hidden', () => {
afterEach(() => {
mockLayoutPrefsStore.timelineBarsVisible = true;
});

it('is true when timeline bars are hidden', () => {
mockLayoutPrefsStore.timelineBarsVisible = false;
renderWithRouter(<TracePage {...defaultProps} />);

Comment on lines +617 to +620
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test name is ambiguous: within calculates hideMap correctly, the new it('is true when timeline bars are hidden'...) doesn’t mention hideMap/minimap, and it only asserts on DOM presence. Consider renaming to explicitly reference hideMap/minimap and (optionally) asserting capturedHeaderProps.hideMap === true to make the intent clearer and less coupled to the mock header markup.

Suggested change
it('is true when timeline bars are hidden', () => {
mockLayoutPrefsStore.timelineBarsVisible = false;
renderWithRouter(<TracePage {...defaultProps} />);
it('sets hideMap to true and hides the minimap when timeline bars are hidden', () => {
mockLayoutPrefsStore.timelineBarsVisible = false;
renderWithRouter(<TracePage {...defaultProps} />);
expect(capturedHeaderProps.hideMap).toBe(true);

Copilot uses AI. Check for mistakes.
const spanGraph = screen.queryByTestId('span-graph');
expect(spanGraph).not.toBeInTheDocument();
});
});
});

describe('calculates hideSummary correctly', () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/jaeger-ui/src/components/TracePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,9 @@ export function TracePageImpl(props: TProps) {
detailPanelMode,
enableSidePanel,
hideMap: Boolean(
viewType !== ETraceViewType.TraceTimelineViewer || (embedded && embedded.timeline.hideMinimap)
viewType !== ETraceViewType.TraceTimelineViewer ||
(embedded && embedded.timeline.hideMinimap) ||
!timelineBarsVisible
),
hideSummary: Boolean(embedded && embedded.timeline.hideSummary),
linkToStandalone: getUrl(id),
Expand Down
Loading