Skip to content

Commit

Permalink
Minor: Automator form fix (open-metadata#16349)
Browse files Browse the repository at this point in the history
* Fix the initial value not applying to the form item for ScheduleInterval component

* Add tests for the default value check for the debug log switch in ScheduleInterval

* Update the whats new content for the automator name changes
  • Loading branch information
aniketkatkar97 authored May 20, 2024
1 parent 1a61a45 commit 38bdcc4
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1355,9 +1355,9 @@ export const WHATS_NEW = [
description: 'Released on 21st May 2024.',
features: [
{
title: 'Automator',
title: 'Automations',
description:
'We have introduced Automator to easily maintain high-quality metadata at scale. The Automator streamlines governance processes from ownership assignments to tagging, ensuring compliance and consistency. We have added support for the following actions: adding and removing owner, tier, domain, tags, glossary terms and descriptions, ML PII tagging, and propagation of tags and glossary terms through lineage.',
'We have introduced Automations to easily maintain high-quality metadata at scale. The Automations streamline governance processes from ownership assignments to tagging, ensuring compliance and consistency. We have added support for the following actions: adding and removing owner, tier, domain, tags, glossary terms and descriptions, ML PII tagging, and propagation of tags and glossary terms through lineage.',
isImage: false,
path: 'https://www.youtube.com/embed/zdh4yzHw4w0',
},
Expand Down Expand Up @@ -1444,7 +1444,7 @@ API:
- Bulk Import API now creates entities if they are not present during the import.
- Table's TestSuite is migrated to EntityReference. Previously it used to store entire payload of TestSuite.
`,
[`Automator ${CollateIconWithLinkMD}`]: `- Easily maintain high-quality metadata at scale with automations. The Automator streamlines governance processes from ownership assignments to tagging, ensuring compliance and consistency.
[`Automations ${CollateIconWithLinkMD}`]: `- Easily maintain high-quality metadata at scale with automations. The Automations streamline governance processes from ownership assignments to tagging, ensuring compliance and consistency.
- You can update the properties of your assets by filtering by service, owner, domain, or any other supported property from the advanced search.
- Easily see which assets have been selected by jumping to the Explore page in one click.
- For tables, data models, topics, and search indexes, you can apply the action to their columns or fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
* limitations under the License.
*/

import { findByTestId, findByText, render } from '@testing-library/react';
import {
findByTestId,
findByText,
render,
screen,
} from '@testing-library/react';
import React from 'react';
import { ScheduleIntervalProps } from '../IngestionWorkflow.interface';
import ScheduleInterval from './ScheduleInterval';
Expand Down Expand Up @@ -48,4 +53,42 @@ describe('Test ScheduleInterval component', () => {
expect(backButton).toBeInTheDocument();
expect(deployButton).toBeInTheDocument();
});

it('should not render debug log switch when allowEnableDebugLog is false', () => {
render(<ScheduleInterval {...mockScheduleIntervalProps} />);

expect(screen.queryByTestId('enable-debug-log')).toBeNull();
});

it('should render enable debug log switch when allowEnableDebugLog is true', () => {
render(
<ScheduleInterval {...mockScheduleIntervalProps} allowEnableDebugLog />
);

expect(screen.getByTestId('enable-debug-log')).toBeInTheDocument();
});

it('debug log switch should be initially checked when debugLogInitialValue is true', () => {
render(
<ScheduleInterval
{...mockScheduleIntervalProps}
allowEnableDebugLog
debugLogInitialValue
/>
);

expect(screen.getByTestId('enable-debug-log')).toHaveClass(
'ant-switch-checked'
);
});

it('debug log switch should not be initially checked when debugLogInitialValue is false', () => {
render(
<ScheduleInterval {...mockScheduleIntervalProps} allowEnableDebugLog />
);

expect(screen.getByTestId('enable-debug-log')).not.toHaveClass(
'ant-switch-checked'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const ScheduleInterval = ({
required: false,
props: {
'data-testid': 'enable-debug-log',
},
formItemProps: {
initialValue: debugLogInitialValue,
},
id: 'root/enableDebugLog',
Expand Down

0 comments on commit 38bdcc4

Please sign in to comment.