diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx
index dc78b4455d54b..c5fb3bdf8357a 100644
--- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx
+++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx
@@ -189,6 +189,43 @@ describe('CreateMaintenanceWindowForm', () => {
expect(managementInput).toBeChecked();
});
+ it('should initialize MWs with selected category ids properly', async () => {
+ const result = appMockRenderer.render(
+
+ );
+
+ await waitFor(() => {
+ expect(
+ result.queryByTestId('maintenanceWindowCategorySelectionLoading')
+ ).not.toBeInTheDocument();
+ });
+
+ const observabilityInput = within(
+ result.getByTestId('maintenanceWindowCategorySelection')
+ ).getByTestId('checkbox-observability');
+ const securityInput = within(
+ result.getByTestId('maintenanceWindowCategorySelection')
+ ).getByTestId('checkbox-securitySolution');
+ const managementInput = within(
+ result.getByTestId('maintenanceWindowCategorySelection')
+ ).getByTestId('checkbox-management');
+
+ expect(observabilityInput).toBeChecked();
+ expect(managementInput).toBeChecked();
+ expect(securityInput).not.toBeChecked();
+ });
+
it('can select category IDs', async () => {
const result = appMockRenderer.render();