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

[Workplace Search] Add top-level tests for Groups #81215

Merged

Conversation

scottybollinger
Copy link
Contributor

Summary

This PR adds the final unit tests for the Groups components in Workplace Search.

2020-10-20_13-29-22

Checklist

Both were originally set to ‘123’
These were never used and were only uncovered while testing. These both exist on `group` but not at the top level.
This is not needed with global flash messages, as the component will not render with no messages.
This allow for testing the component visiblity and aligns with other usage of React Router
This commit removes the useDidUpdateEffect custom hook and moves the logic to fetch the search results to a listener inside of Kea.
@scottybollinger scottybollinger added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.11.0 labels Oct 20, 2020
@scottybollinger scottybollinger requested a review from a team as a code owner October 20, 2020 17:39
The issue was that the delay needed to be in the catch block to properly execute.
In other places in the tests, we explicitly test for an error string in the catch block. Changing this to match.
Copy link
Contributor

@yakhinvadim yakhinvadim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tests! 💯 👏

@scottybollinger
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id before after diff
enterpriseSearch 417 415 -2

async chunks size

id before after diff
enterpriseSearch 642.7KB 642.3KB -395.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@scottybollinger scottybollinger merged commit b2fc892 into elastic:master Oct 22, 2020
@scottybollinger scottybollinger deleted the scottybollinger/groups-tests branch October 22, 2020 01:23
scottybollinger added a commit to scottybollinger/kibana that referenced this pull request Oct 22, 2020
* Update id of second sources mock to be unique

Both were originally set to ‘123’

* Remove unused types from interface

These were never used and were only uncovered while testing. These both exist on `group` but not at the top level.

* Add group mock

* Fix typo in reducer name

* Add tests for group_logic

* Remove redundant messages check

This is not needed with global flash messages, as the component will not render with no messages.

* Add tests for group_router

* Add group mock

* Add tests for groups_logic

* Convert groups_router to use children

This allow for testing the component visiblity and aligns with other usage of React Router

* Add tests for groups_router

* Refactor pagination logic

This commit removes the useDidUpdateEffect custom hook and moves the logic to fetch the search results to a listener inside of Kea.

* dd tests for main groups container

* Lint fixes

* Fix broken test and remove comment

The issue was that the delay needed to be in the catch block to properly execute.

* Add comments and make test explicit

In other places in the tests, we explicitly test for an error string in the catch block. Changing this to match.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
scottybollinger added a commit that referenced this pull request Oct 22, 2020
* Update id of second sources mock to be unique

Both were originally set to ‘123’

* Remove unused types from interface

These were never used and were only uncovered while testing. These both exist on `group` but not at the top level.

* Add group mock

* Fix typo in reducer name

* Add tests for group_logic

* Remove redundant messages check

This is not needed with global flash messages, as the component will not render with no messages.

* Add tests for group_router

* Add group mock

* Add tests for groups_logic

* Convert groups_router to use children

This allow for testing the component visiblity and aligns with other usage of React Router

* Add tests for groups_router

* Refactor pagination logic

This commit removes the useDidUpdateEffect custom hook and moves the logic to fetch the search results to a listener inside of Kea.

* dd tests for main groups container

* Lint fixes

* Fix broken test and remove comment

The issue was that the delay needed to be in the catch block to properly execute.

* Add comments and make test explicit

In other places in the tests, we explicitly test for an error string in the catch block. Changing this to match.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Oct 22, 2020
* master: (63 commits)
  [KP] Fix Headers timeout issue (elastic#81140)
  [ML] Functional tests - stabilize typing with checks service method (elastic#81338)
  tabify - support docs (elastic#80351)
  [Security Solution][Detections] Look-back time logic fix (elastic#81383)
  [Workplace Search] Add top-level tests for Groups (elastic#81215)
  [Fleet] Fix agent action observable for long polling (elastic#81376)
  [Maps] fix feature tooltip remains open when zoom level change hides layer (elastic#81373)
  skip flaky suite (elastic#78689)
  chore(NA): add spec-to-console and plugin-helpers as devOnly dependencies (elastic#81357)
  Ensure some data is returned (elastic#81375)
  Change dumb-init to tini (elastic#81126)
  [Reporting/Tech Debt] Convert PdfMaker class to TypeScript (elastic#81242)
  Use Storybook Controls instead of Knobs (elastic#80705)
  [junit] make sure that report paths are unique (elastic#81255)
  bump elastic/elasticsearch-js version to 7.10.0-rc1 (elastic#81288)
  run ssl tests on CI (elastic#81320)
  Fix alert defaults (elastic#81207)
  [ML] DF Analytics wizard: ensure user can set mml manually or select to use given estimate (elastic#81078)
  Add UI notifier to indicate secret fields and to remember / reenter values (elastic#80657)
  [Monitoring] Use async/await (elastic#81200)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants