Skip to content

Commit

Permalink
[Security Solution] Test rule_details_ui/pages/rule_details/index.tes…
Browse files Browse the repository at this point in the history
…t.tsx logs a warning about wrong props passed to EuiSwitch (elastic#162229)

## Summary

Related ticket: elastic#147065

This PR fixes the warning within the
`rule_details_ui/pages/rule_details/index.test.tsx` test which happens
because instead of using required `EuiSwitch`'s `label` field we pass
`undefined`.

Since, we do not intend to show the label we make it explicitly with
`showLabel={false}` and set `label` to an empty string.

For more details see [the overview of the
EuiSwitch](https://elastic.github.io/eui/#/forms/selection-controls)
component.
  • Loading branch information
e40pud authored and dgieselaar committed Jul 23, 2023
1 parent 3e043cd commit e5cdc48
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -88,7 +88,8 @@ export const RuleSwitchComponent = ({
) : (
<StaticSwitch
data-test-subj="ruleSwitch"
label={undefined}
showLabel={false}
label=""
disabled={isDisabled}
checked={enabled}
onChange={onRuleStateChange}
Expand Down

0 comments on commit e5cdc48

Please sign in to comment.