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

Failing test: Jest Tests.x-pack/plugins/cases/public/components/create - Create case should NOT call createAttachments if the attachments are an empty array #142285

Closed
kibanamachine opened this issue Sep 29, 2022 · 4 comments
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Sep 29, 2022

A test failed on a tracked branch

TestingLibraryElementError: Unable to find an element by: [data-test-subj="caseTitle"]

Ignored nodes: comments, <script />, <style />
<body
  class=""
>
  <div />
</body>
    at Object.getElementError (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/config.js:38:19)
    at /var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/query-helpers.js:90:38
    at /var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/query-helpers.js:62:17
    at getByTestId (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/query-helpers.js:111:19)
    at fillFormReactTestingLib (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/x-pack/plugins/cases/public/components/create/form_context.test.tsx:101:42)
    at Object.<anonymous> (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/x-pack/plugins/cases/public/components/create/form_context.test.tsx:866:11)
    at Promise.then.completed (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/utils.js:276:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/utils.js:216:10)
    at _callCircusTest (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:212:40)
    at _runTest (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/buildkite-agent/builds/kb-n2-4-spot-df08b440c5dd8216/elastic/kibana-on-merge/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

First failure: CI Build - 8.5

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Sep 29, 2022
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 29, 2022
@kibanamachine kibanamachine added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Sep 29, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Sep 29, 2022
@cnasikas cnasikas added the Feature:Cases Cases feature label Sep 30, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@cnasikas cnasikas self-assigned this Nov 15, 2022
cnasikas added a commit that referenced this issue Nov 16, 2022
## Summary

This PR fixes a number of issues with the same error:
`TestingLibraryElementError: Unable to find an element by:
[data-test-subj="caseTitle"]`. The PR:

- Clears unnecessary `act`
- Wait for the form to render before trying to fill the form
- Wait for the component to update all states to eliminate warnings
- Fill tags when necessary to improve tests execution time
- Replace `userEvent.type` with `userEvent.aste` when possible to
improve execution time
- Add `skipPointerEventsCheck: true` when necessary

I run the test file 100 times locally without any errors.

Fixes: #142287,
#142288,
#142285,
#142286,
#142284,
#142283,
#142282,
#142281,
#143407,
#143406,
#143405,
#143408,
#143403

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
@cnasikas
Copy link
Member

Fixed by #145211

kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 16, 2022
## Summary

This PR fixes a number of issues with the same error:
`TestingLibraryElementError: Unable to find an element by:
[data-test-subj="caseTitle"]`. The PR:

- Clears unnecessary `act`
- Wait for the form to render before trying to fill the form
- Wait for the component to update all states to eliminate warnings
- Fill tags when necessary to improve tests execution time
- Replace `userEvent.type` with `userEvent.aste` when possible to
improve execution time
- Add `skipPointerEventsCheck: true` when necessary

I run the test file 100 times locally without any errors.

Fixes: elastic#142287,
elastic#142288,
elastic#142285,
elastic#142286,
elastic#142284,
elastic#142283,
elastic#142282,
elastic#142281,
elastic#143407,
elastic#143406,
elastic#143405,
elastic#143408,
elastic#143403

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 6936644)
benakansara pushed a commit to benakansara/kibana that referenced this issue Nov 17, 2022
## Summary

This PR fixes a number of issues with the same error:
`TestingLibraryElementError: Unable to find an element by:
[data-test-subj="caseTitle"]`. The PR:

- Clears unnecessary `act`
- Wait for the form to render before trying to fill the form
- Wait for the component to update all states to eliminate warnings
- Fill tags when necessary to improve tests execution time
- Replace `userEvent.type` with `userEvent.aste` when possible to
improve execution time
- Add `skipPointerEventsCheck: true` when necessary

I run the test file 100 times locally without any errors.

Fixes: elastic#142287,
elastic#142288,
elastic#142285,
elastic#142286,
elastic#142284,
elastic#142283,
elastic#142282,
elastic#142281,
elastic#143407,
elastic#143406,
elastic#143405,
elastic#143408,
elastic#143403

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Feature:Cases Cases feature Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

No branches or pull requests

3 participants