Skip to content

Commit

Permalink
do unit test instead e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
guskovaue committed Aug 11, 2023
1 parent ee3a555 commit eb5c988
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => (
<div data-test-subj="mocked-MaintenanceWindowCallout-component" />
)),
}));

jest.mock('../../../lib/capabilities', () => ({
hasAllPrivilege: jest.fn(() => true),
Expand Down Expand Up @@ -246,6 +250,13 @@ describe('rules_list component empty', () => {
expect(await screen.findByTestId('createFirstRuleEmptyPrompt')).toBeInTheDocument();
});

it('renders MaintenanceWindowCallout mocked component', async () => {
renderWithProviders(<RulesList />);
expect(
await screen.findByTestId('mocked-MaintenanceWindowCallout-component')
).toBeInTheDocument();
});

it('renders Create rule button', async () => {
renderWithProviders(<RulesList showCreateRuleButtonInPrompt />);

Expand Down

This file was deleted.

0 comments on commit eb5c988

Please sign in to comment.