Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Test rule_details_ui/pages/rule_details/index.test.tsx logs a warning about wrong props passed to EuiSwitch #147065

Closed
Tracked by #161507
kibanamachine opened this issue Dec 6, 2022 · 3 comments
Assignees
Labels
8.10 candidate failed-test A test failure on a tracked branch, potentially flaky-test Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. test

Comments

@kibanamachine
Copy link
Contributor

A test failed on a tracked branch

Error: expect(received).toBeFalsy()

Received: true

Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div
      aria-atomic="true"
      aria-live="assertive"
      id="rbd-announcement-0"
      style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
    />
    <div
      id="rbd-hidden-text-0-hidden-text-0"
      style="display: none;"
    >
      
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key

    </div>
    <div
      aria-atomic="true"
      aria-live="assertive"
      id="rbd-announcement-1"
      style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
    />
    <div
      id="rbd-hidden-text-1-hidden-text-1"
      style="display: none;"
    >
      
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key

    </div>
    <div
      aria-atomic="true"
      aria-live="assertive"
      id="rbd-announcement-2"
      style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
    />
    <div
      id="rbd-hidden-text-2-hidden-text-2"
      style="display: none;"
    >
      
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key

    </div>
    <div
      aria-atomic="true"
      aria-live="assertive"
      id="rbd-announcement-3"
      style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
    />
    <div
      id="rbd-hidden-text-3-hidden-text-3"
      style="display: none;"
    >
      
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key

    </div>
    <div
      aria-atomic="true"
      aria-live="assertive"
      id="rbd-announcement-4"
      style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
    />
    <div
      id="rbd-hidden-text-4-hidden-text-4"
      style="display: none;"
    >
      
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key

    </div>
  </body>
</html>...
    at /var/lib/buildkite-agent/builds/kb-n2-4-spot-f2a6a39154e81d67/elastic/kibana-on-merge/kibana/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.test.tsx:323:9
    at runWithExpensiveErrorDiagnosticsDisabled (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f2a6a39154e81d67/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/config.js:52:12)
    at checkCallback (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f2a6a39154e81d67/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/wait-for.js:141:77)
    at checkRealTimersCallback (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f2a6a39154e81d67/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/wait-for.js:133:16)
    at Timeout.task [as _onTimeout] (/var/lib/buildkite-agent/builds/kb-n2-4-spot-f2a6a39154e81d67/elastic/kibana-on-merge/kibana/node_modules/jsdom/lib/jsdom/browser/Window.js:516:19)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

First failure: CI Build - 8.6

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Dec 6, 2022
@botelastic botelastic bot added the needs-team Issues missing a team label label Dec 6, 2022
@kibanamachine kibanamachine added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Dec 6, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Dec 6, 2022
@MadameSheema MadameSheema added Team:Detections and Resp Security Detection Response Team Team:Detection Rule Management Security Detection Rule Management Team labels May 23, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@banderror
Copy link
Contributor

x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.test.tsx passes in main:

 PASS  x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.test.tsx (21.749 s)
  RuleDetailsPageComponent
    ✓ renders correctly with no outcome property on rule (709 ms)
    ✓ renders correctly with outcome === "exactMatch" (292 ms)
    ✓ renders correctly with outcome === "aliasMatch" (273 ms)
    ✓ renders correctly when outcome = conflict (260 ms)
    ✓ renders exceptions tab (269 ms)
    ✓ renders endpoint exceptions tab when rule includes endpoint list (247 ms)

but logs a console error saying that there's something wrong with props passes to EuiSwitch:

  console.error
    Warning: Failed prop type: The prop `label` is marked as required in `EuiSwitch`, but its value is `undefined`.
        at EuiSwitch (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/form/switch/switch.js:21:20)
        at forwardRef (/Users/georgii/Code/elastic/kibana-pr1/node_modules/styled-components/dist/styled-components.cjs.js:1590:12)
        at div
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at EuiFlexItem (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/flex/flex_item.js:17:23)
        at div
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/flex/flex_group.js:32:23
        at id (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx:40:3)
        at div
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/flex/flex_group.js:32:23
        at span
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/tool_tip/tool_tip_anchor.js:23:22
        at EuiToolTip (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/tool_tip/tool_tip.js:69:34)
        at div
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at EuiFlexItem (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/flex/flex_item.js:17:23)
        at div
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/flex/flex_group.js:32:23
        at div
        at EuiPageHeaderSection (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/page/page_header/page_header_section.js:16:23)
        at div
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at div
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at EuiPageHeaderContent (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/page/page_header/page_header_content.js:35:24)
        at header
        at /Users/georgii/Code/elastic/kibana-pr1/node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js:43:23
        at EuiPageHeader (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@elastic/eui/test-env/components/page/page_header/page_header.js:20:24)
        at backOptions (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx:110:3)
        at div
        at forwardRef (/Users/georgii/Code/elastic/kibana-pr1/node_modules/styled-components/dist/styled-components.cjs.js:1590:12)
        at div
        at forwardRef (/Users/georgii/Code/elastic/kibana-pr1/node_modules/styled-components/dist/styled-components.cjs.js:1590:12)
        at children (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/common/components/page_wrapper/index.tsx:43:8)
        at children (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/rule_details_context.tsx:123:46)
        at div
        at forwardRef (/Users/georgii/Code/elastic/kibana-pr1/node_modules/styled-components/dist/styled-components.cjs.js:1590:12)
        at clearEventsDeleted (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx:180:3)
        at ConnectFunction (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-redux/lib/components/connectAdvanced.js:235:41)
        at Router (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-router/cjs/react-router.js:99:30)
        at Provider (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-redux/lib/components/Provider.js:21:20)
        at App (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.cjs.js:6841:25)
        at ErrorBoundary (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.cjs.js:104:35)
        at DragDropContext (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.cjs.js:6970:19)
        at children (/Users/georgii/Code/elastic/kibana-pr1/packages/kbn-cell-actions/src/context/cell_actions_context.tsx:16:3)
        at storage (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/console_manager.tsx:67:60)
        at children (/Users/georgii/Code/elastic/kibana-pr1/packages/kbn-expandable-flyout/src/context.tsx:95:6)
        at client (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx:72:3)
        at ThemeProvider (/Users/georgii/Code/elastic/kibana-pr1/node_modules/styled-components/dist/styled-components.cjs.js:1430:26)
        at Provider (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-redux/lib/components/Provider.js:21:20)
        at newServices (/Users/georgii/Code/elastic/kibana-pr1/src/plugins/kibana_react/public/context/context.tsx:49:15)
        at children (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts:208:13)
        at PseudoLocaleWrapper (/Users/georgii/Code/elastic/kibana-pr1/packages/kbn-i18n-react/src/pseudo_locale_wrapper.tsx:51:5)
        at IntlProvider (/Users/georgii/Code/elastic/kibana-pr1/node_modules/react-intl/lib/index.js:914:5)
        at children (/Users/georgii/Code/elastic/kibana-pr1/packages/kbn-i18n-react/src/provider.tsx:23:42)
        at children (/Users/georgii/Code/elastic/kibana-pr1/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx:58:3)
        at WrapperComponent (/Users/georgii/Code/elastic/kibana-pr1/node_modules/@wojtekmaj/enzyme-adapter-utils/src/createMountWrapper.jsx:46:26)

This warning could indicate a bug, so probably it's worth investigating.

@banderror banderror changed the title Failing test: Jest Tests.x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details - RuleDetailsPageComponent renders exceptions tab [Security Solution] Test rule_details_ui/pages/rule_details/index.test.tsx logs a warning about wrong props passed to EuiSwitch May 25, 2023
@e40pud e40pud self-assigned this Jul 17, 2023
e40pud added a commit to e40pud/kibana that referenced this issue Jul 19, 2023
…t.tsx logs a warning about wrong props passed to EuiSwitch (elastic#147065)
e40pud added a commit that referenced this issue Jul 20, 2023
…t.tsx logs a warning about wrong props passed to EuiSwitch (#162229)

## Summary

Related ticket: #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.
@e40pud e40pud closed this as completed Jul 20, 2023
ThomThomson pushed a commit to ThomThomson/kibana that referenced this issue Aug 1, 2023
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.10 candidate failed-test A test failure on a tracked branch, potentially flaky-test Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. test
Projects
None yet
Development

No branches or pull requests

5 participants