diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx
index 1a1a3eab0cf14..0c2c508b3f719 100644
--- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx
+++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx
@@ -104,7 +104,11 @@ jest.mock('react-router-dom', () => ({
pathname: '/triggersActions/rules/',
}),
}));
-jest.mock('@kbn/alerts-ui-shared', () => ({ MaintenanceWindowCallout: jest.fn(() => <>>) }));
+jest.mock('@kbn/alerts-ui-shared', () => ({
+ MaintenanceWindowCallout: jest.fn(() => (
+
+ )),
+}));
jest.mock('../../../lib/capabilities', () => ({
hasAllPrivilege: jest.fn(() => true),
@@ -246,6 +250,13 @@ describe('rules_list component empty', () => {
expect(await screen.findByTestId('createFirstRuleEmptyPrompt')).toBeInTheDocument();
});
+ it('renders MaintenanceWindowCallout mocked component', async () => {
+ renderWithProviders();
+ expect(
+ await screen.findByTestId('mocked-MaintenanceWindowCallout-component')
+ ).toBeInTheDocument();
+ });
+
it('renders Create rule button', async () => {
renderWithProviders();
diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/rules_list/maintenance_window_banner.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/rules_list/maintenance_window_banner.ts
deleted file mode 100644
index fdaf29fea63b0..0000000000000
--- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/rules_list/maintenance_window_banner.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 { FtrProviderContext } from '../../../ftr_provider_context';
-import { ObjectRemover } from '../../../lib/object_remover';
-import { generateUniqueKey } from '../../../lib/get_test_data';
-import { createMaintenanceWindow, createObjectRemover } from '../maintenance_windows/utils';
-
-export default ({ getPageObjects, getService }: FtrProviderContext) => {
- const testSubjects = getService('testSubjects');
- const pageObjects = getPageObjects(['common']);
-
- let objectRemover: ObjectRemover;
- const browser = getService('browser');
-
- describe('Maintenance windows banner', () => {
- before(async () => {
- objectRemover = await createObjectRemover({ getService });
- });
-
- after(async () => {
- await objectRemover.removeAll();
- });
-
- it('should not show a maintenance window banner', async () => {
- await pageObjects.common.navigateToApp('triggersActions');
- await testSubjects.click('rulesTab');
- await testSubjects.missingOrFail('maintenanceWindow');
- });
-
- it('should show a maintenance window banner', async () => {
- await pageObjects.common.navigateToApp('maintenanceWindows');
- const name = generateUniqueKey();
- const createdMaintenanceWindow = await createMaintenanceWindow({
- name,
- getService,
- });
- objectRemover.add(createdMaintenanceWindow.id, 'rules/maintenance_window', 'alerting', true);
- await browser.refresh();
-
- await pageObjects.common.navigateToApp('triggersActions');
- await testSubjects.click('rulesTab');
- await testSubjects.existOrFail('maintenanceWindow');
- });
- });
-};