- {patterns.map((pattern) => (
-
-
-
- ))}
+ {useMemo(
+ () =>
+ patterns.map((pattern) => (
+
+
+
+ )),
+ [
+ chartSelectedIndex,
+ firstOpenPattern,
+ handleAccordionToggle,
+ handleDismissTour,
+ isTourActive,
+ patternIndexNames,
+ patternRollups,
+ patterns,
+ setChartSelectedIndex,
+ ]
+ )}
);
};
diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts
index 4bab5938cf98b..a02eccb3e81a4 100644
--- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts
+++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts
@@ -9,3 +9,5 @@ export const MIN_PAGE_SIZE = 10;
export const HISTORY_TAB_ID = 'history';
export const LATEST_CHECK_TAB_ID = 'latest_check';
+
+export const HISTORICAL_RESULTS_TOUR_SELECTOR_KEY = 'data-tour-element';
diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.test.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.test.tsx
new file mode 100644
index 0000000000000..53f2e059072c8
--- /dev/null
+++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.test.tsx
@@ -0,0 +1,105 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0; you may not use this file except in compliance with the Elastic License
+ * 2.0.
+ */
+
+import React from 'react';
+import { render, screen, waitFor } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+
+import { HISTORICAL_RESULTS_TOUR_SELECTOR_KEY } from '../constants';
+import { HistoricalResultsTour } from '.';
+import { INTRODUCING_DATA_QUALITY_HISTORY, VIEW_PAST_RESULTS } from './translations';
+
+const anchorSelectorValue = 'test-anchor';
+
+describe('HistoricalResultsTour', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ });
+
+ describe('given no anchor element', () => {
+ it('does not render the tour step', () => {
+ render(
+