Skip to content

Commit

Permalink
call isSecurityExampleEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Oct 18, 2020
1 parent a8a6140 commit 4b72e62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ describe('TelemetryManagementSectionComponent', () => {
);

try {
const description = component.instance().renderDescription({ securityExampleEnabled: false });
const description = (component.instance() as TelemetryManagementSection).renderDescription();
expect(isSecurityExampleEnabled).toBeCalled();
expect(description).toMatchSnapshot();
} finally {
component.unmount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class TelemetryManagementSection extends Component<Props, State> {
defaultMessage: 'Provide usage statistics',
}),
value: enabled,
description: this.renderDescription({ securityExampleEnabled }),
description: this.renderDescription(),
defVal: true,
ariaName: i18n.translate('telemetry.provideUsageStatisticsAriaName', {
defaultMessage: 'Provide usage statistics',
Expand Down Expand Up @@ -185,7 +185,9 @@ export class TelemetryManagementSection extends Component<Props, State> {
);
};

renderDescription = ({ securityExampleEnabled }: { securityExampleEnabled: boolean }) => {
renderDescription = () => {
const { isSecurityExampleEnabled } = this.props;
const securityExampleEnabled = isSecurityExampleEnabled();
const clusterDataLink = (
<EuiLink onClick={this.toggleExample} data-test-id="cluster_data_example">
<FormattedMessage id="telemetry.clusterData" defaultMessage="cluster data" />
Expand Down

0 comments on commit 4b72e62

Please sign in to comment.