diff --git a/src/gitops/Statuses/ApplicationSetStatus.test.tsx b/src/gitops/Statuses/ApplicationSetStatus.test.tsx
new file mode 100644
index 000000000..21c13076c
--- /dev/null
+++ b/src/gitops/Statuses/ApplicationSetStatus.test.tsx
@@ -0,0 +1,29 @@
+import { renderToStaticMarkup } from 'react-dom/server';
+
+import ApplicationSetStatus from './ApplicationSetStatus';
+
+describe('ApplicationSetStatus', () => {
+ it('renders Healthy', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `" Healthy"`,
+ );
+ });
+
+ it('renders Error', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `" Error"`,
+ );
+ });
+
+ it('renders Unknown for unrecognised status', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `" Unknown"`,
+ );
+ });
+
+ it('renders Unknown icon for empty status', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `" "`,
+ );
+ });
+});
diff --git a/src/gitops/Statuses/ApplicationSetStatus.tsx b/src/gitops/Statuses/ApplicationSetStatus.tsx
new file mode 100644
index 000000000..077512365
--- /dev/null
+++ b/src/gitops/Statuses/ApplicationSetStatus.tsx
@@ -0,0 +1,34 @@
+import * as React from 'react';
+import {
+ HealthDegradedIcon,
+ HealthHealthyIcon,
+ HealthUnknownIcon,
+} from 'src/gitops/utils/components/Icons/Icons';
+import { ApplicationSetStatus as AppSetStatus } from 'src/gitops/utils/constants';
+
+interface ApplicationSetStatusProps {
+ status: string;
+}
+
+const ApplicationSetStatus: React.FC = ({ status }) => {
+ let targetIcon: React.ReactNode;
+
+ switch (status) {
+ case AppSetStatus.HEALTHY:
+ targetIcon = ;
+ break;
+ case AppSetStatus.ERROR:
+ targetIcon = ;
+ break;
+ default:
+ targetIcon = ;
+ }
+
+ return (
+
+ {targetIcon} {status}
+
+ );
+};
+
+export default ApplicationSetStatus;
diff --git a/src/gitops/Statuses/HealthStatus.test.tsx b/src/gitops/Statuses/HealthStatus.test.tsx
index 28051d55a..9ff85b36d 100644
--- a/src/gitops/Statuses/HealthStatus.test.tsx
+++ b/src/gitops/Statuses/HealthStatus.test.tsx
@@ -20,12 +20,30 @@ describe('HealthStatus', () => {
);
});
+ it('renders Suspended', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `""`,
+ );
+ });
+
+ it('renders Missing', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `""`,
+ );
+ });
+
it('renders Unknown for unrecognized status', () => {
expect(renderToStaticMarkup()).toMatchInlineSnapshot(
`""`,
);
});
+ it('renders Unknown for undefined status', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `""`,
+ );
+ });
+
it('renders popover when message is provided', () => {
expect(
renderToStaticMarkup(),
@@ -65,4 +83,12 @@ describe('HealthStatusIcon', () => {
`""`,
);
});
+
+ it('renders Unknown icon for unrecognised status', () => {
+ expect(
+ renderToStaticMarkup(),
+ ).toMatchInlineSnapshot(
+ `""`,
+ );
+ });
});
diff --git a/src/gitops/Statuses/SyncStatus.test.tsx b/src/gitops/Statuses/SyncStatus.test.tsx
index 1796a6c8a..bb417b365 100644
--- a/src/gitops/Statuses/SyncStatus.test.tsx
+++ b/src/gitops/Statuses/SyncStatus.test.tsx
@@ -25,4 +25,10 @@ describe('SyncStatus', () => {
`" "`,
);
});
+
+ it('renders Unknown icon for undefined status', () => {
+ expect(renderToStaticMarkup()).toMatchInlineSnapshot(
+ `" "`,
+ );
+ });
});
diff --git a/src/gitops/components/shared/ApplicationSetList.tsx b/src/gitops/components/shared/ApplicationSetList.tsx
index 49edec67d..d025d9447 100644
--- a/src/gitops/components/shared/ApplicationSetList.tsx
+++ b/src/gitops/components/shared/ApplicationSetList.tsx
@@ -26,13 +26,8 @@ import { Tbody, Td, ThProps, Tr } from '@patternfly/react-table';
import { useApplicationSetActionsProvider } from '../../hooks/useApplicationSetActionsProvider';
import { ApplicationSetKind, ApplicationSetModel } from '../../models/ApplicationSetModel';
+import ApplicationSetStatusFragment from '../../Statuses/ApplicationSetStatus';
import ActionsDropdown from '../../utils/components/ActionDropDown/ActionDropDown';
-// Import status icons for consistency with ApplicationList
-import {
- HealthDegradedIcon,
- HealthHealthyIcon,
- HealthUnknownIcon,
-} from '../../utils/components/Icons/Icons';
import { ApplicationSetStatus } from '../../utils/constants';
import { getAppSetGeneratorCount, getAppSetStatus } from '../../utils/gitops';
import { modelToGroupVersionKind, modelToRef } from '../../utils/utils';
@@ -90,27 +85,6 @@ const getGeneratedAppsCount = (
}).length;
};
-const ApplicationSetStatusFragment: React.FC<{ status: string }> = ({ status }) => {
- let targetIcon: React.ReactNode;
-
- switch (status) {
- case ApplicationSetStatus.HEALTHY:
- targetIcon = ;
- break;
- case ApplicationSetStatus.ERROR:
- targetIcon = ;
- break;
- default:
- targetIcon = ;
- }
-
- return (
-
- {targetIcon} {status}
-
- );
-};
-
interface ApplicationSetProps {
namespace: string;
hideNameLabelFilters?: boolean;