diff --git a/CHANGELOG.md b/CHANGELOG.md
index aed16fbe88f9..102205566e80 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -71,6 +71,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### 🔩 Tests
+- [Home] Add more unit tests for other complications of overview ([#5418](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5418))
+
## [2.11.1 - 2023-11-21](https://github.com/opensearch-project/OpenSearch-Dashboards/releases/tag/2.11.1)
### 🛡 Security
diff --git a/src/plugins/opensearch_dashboards_overview/public/components/overview/__snapshots__/overview.test.tsx.snap b/src/plugins/opensearch_dashboards_overview/public/components/overview/__snapshots__/overview.test.tsx.snap
index 6d92c8759243..1619a4fea3ff 100644
--- a/src/plugins/opensearch_dashboards_overview/public/components/overview/__snapshots__/overview.test.tsx.snap
+++ b/src/plugins/opensearch_dashboards_overview/public/components/overview/__snapshots__/overview.test.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Overview renders with solutions and features 1`] = `
+exports[`Overview renders with news without solutions and without features 1`] = `
-
-
-
-
-
-
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_opensearch_dashboards_light_2x.png"
- title="OpenSearch Dashboards"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_2_light_2x.png"
- title="Solution two"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_3_light_2x.png"
- title="Solution three"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_4_light_2x.png"
- title="Solution four"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Overview renders with news, solutions, and features 1`] = `
+
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_opensearch_dashboards_light_2x.png"
+ title="OpenSearch Dashboards"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_2_light_2x.png"
+ title="Solution two"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_3_light_2x.png"
+ title="Solution three"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_4_light_2x.png"
+ title="Solution four"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Overview renders with news, with solutions, and without features 1`] = `
+
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_opensearch_dashboards_light_2x.png"
+ title="OpenSearch Dashboards"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_2_light_2x.png"
+ title="Solution two"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_3_light_2x.png"
+ title="Solution three"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_4_light_2x.png"
+ title="Solution four"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Overview renders with news, without solutions, and with features 1`] = `
+
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Overview renders without news and features, with solutions 1`] = `
+
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_opensearch_dashboards_light_2x.png"
+ title="OpenSearch Dashboards"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_2_light_2x.png"
+ title="Solution two"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_3_light_2x.png"
+ title="Solution three"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_4_light_2x.png"
+ title="Solution four"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Overview renders without news and solutions, with features 1`] = `
+
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`;
-exports[`Overview renders with solutions and without features 1`] = `
+exports[`Overview renders without news, solutions, and features 1`] = `
- }
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_opensearch_dashboards_light_2x.png"
- title="OpenSearch Dashboards"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_2_light_2x.png"
- title="Solution two"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_3_light_2x.png"
- title="Solution three"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
-
- }
- image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_4_light_2x.png"
- title="Solution four"
- titleElement="h3"
- titleSize="xs"
- />
-
-
-
-
+ Object {
+ "type": "return",
+ "value": "/plugins/opensearchDashboardsOverview/assets/solutions_solution_3_light_2x.png",
+ },
+ Object {
+ "type": "return",
+ "value": "path-to-solution-four",
+ },
+ Object {
+ "type": "return",
+ "value": "/plugins/opensearchDashboardsOverview/assets/solutions_solution_4_light_2x.png",
+ },
+ ],
+ }
+ }
+ hideToolbar={false}
+ logos={
+ Object {
+ "AnimatedMark": Object {
+ "dark": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_spinner_on_dark.svg",
+ },
+ "light": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ },
+ "type": "default",
+ "url": "/ui/logos/opensearch_spinner_on_light.svg",
+ },
+ "Application": Object {
+ "dark": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_dashboards_on_dark.svg",
+ },
+ "light": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_dashboards_on_light.svg",
+ },
+ "type": "default",
+ "url": "/ui/logos/opensearch_dashboards_on_light.svg",
+ },
+ "CenterMark": Object {
+ "dark": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_center_mark_on_dark.svg",
+ },
+ "light": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_center_mark_on_light.svg",
+ },
+ "type": "default",
+ "url": "/ui/logos/opensearch_center_mark_on_light.svg",
+ },
+ "Mark": Object {
+ "dark": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_mark_on_dark.svg",
+ },
+ "light": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_mark_on_light.svg",
+ },
+ "type": "default",
+ "url": "/ui/logos/opensearch_mark_on_light.svg",
+ },
+ "OpenSearch": Object {
+ "dark": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_on_dark.svg",
+ },
+ "light": Object {
+ "type": "default",
+ "url": "/ui/logos/opensearch_on_light.svg",
+ },
+ "type": "default",
+ "url": "/ui/logos/opensearch_on_light.svg",
+ },
+ "colorScheme": "light",
+ }
+ }
+ showIcon={true}
+ title={
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
`;
-exports[`Overview renders without solutions and with features 1`] = `
+exports[`Overview renders without news, with solutions and features 1`] = `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_opensearch_dashboards_light_2x.png"
+ title="OpenSearch Dashboards"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_2_light_2x.png"
+ title="Solution two"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_3_light_2x.png"
+ title="Solution three"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
+
+ }
+ image="/plugins/opensearchDashboardsOverview/assets/solutions_solution_4_light_2x.png"
+ title="Solution four"
+ titleElement="h3"
+ titleSize="xs"
+ />
+
+
+
+
({
describe('Overview', () => {
describe('renders', () => {
- it('with solutions and features', () => {
+ it('with news, solutions, and features', () => {
const props = {
...makeProps(),
};
@@ -181,7 +181,7 @@ describe('Overview', () => {
expect(component).toMatchSnapshot();
});
- it('without solutions and with features', () => {
+ it('with news, without solutions, and with features', () => {
const props = {
...makeProps(),
solutions: [],
@@ -189,7 +189,8 @@ describe('Overview', () => {
const component = shallowWithIntl();
expect(component).toMatchSnapshot();
});
- it('with solutions and without features', () => {
+
+ it('with news, with solutions, and without features', () => {
const props = {
...makeProps(),
features: [],
@@ -197,9 +198,55 @@ describe('Overview', () => {
const component = shallowWithIntl();
expect(component).toMatchSnapshot();
});
- });
- // ToDo: Add tests for all the complications of Overview
- // https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4693
- it.todo('renders each of the complications of Overview');
+ it('without news, with solutions and features', () => {
+ const props = {
+ ...makeProps(),
+ newsFetchResult: null,
+ };
+ const component = shallowWithIntl();
+ expect(component).toMatchSnapshot();
+ });
+
+ it('with news without solutions and without features', () => {
+ const props = {
+ ...makeProps(),
+ features: [],
+ solutions: [],
+ };
+ const component = shallowWithIntl();
+ expect(component).toMatchSnapshot();
+ });
+
+ it('without news and solutions, with features', () => {
+ const props = {
+ ...makeProps(),
+ newsFetchResult: null,
+ solutions: [],
+ };
+ const component = shallowWithIntl();
+ expect(component).toMatchSnapshot();
+ });
+
+ it('without news and features, with solutions', () => {
+ const props = {
+ ...makeProps(),
+ newsFetchResult: null,
+ features: [],
+ };
+ const component = shallowWithIntl();
+ expect(component).toMatchSnapshot();
+ });
+
+ it('without news, solutions, and features', () => {
+ const props = {
+ ...makeProps(),
+ newsFetchResult: null,
+ features: [],
+ solutions: [],
+ };
+ const component = shallowWithIntl();
+ expect(component).toMatchSnapshot();
+ });
+ });
});