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

[Resolver] Improve simulator. Add more click-through tests and panel tests. #74601

Merged
merged 13 commits into from
Aug 11, 2020

Conversation

oatkiller
Copy link
Contributor

@oatkiller oatkiller commented Aug 6, 2020

Summary

Improved the simulator.

  • Replace mapStateTransitions with map. The usage and interface are the same, but map is not dependent on redux state. This will work for parts of the app that don't use redux (aka EUI). map also forces any AutoSizer instances used by EUI to show their full contents. AutoSizer works but it doesn't behave as expected in JSDOM. With this hack in place, we can bypass AutoSizer. Going forward, we should make sure to use something other than EuiSelectable for the dropdowns
  • Removed the connectEnzymeWrapperAndStore test helper. The new map simulator method doesn't rely on redux so we no longer need this explicit sync.
  • The simulator can receive a memory history instance. This allows tests to pass in a precreated / controlled memory instance. Useful for testing the query string. This design is not final. Instead we could have an 'intiialHistorySearch' parameter that sets the query string on instantiation as well as 'pushHistory' and 'replaceHistory' methods?
  • findInDom is now called domNodes.
  • processNodeElementLooksSelected and processNodeElementLooksUnselected are gone. Instead use selectedProcessNode and unselectedProcessNode to find the wrappers and assert that they wrappers contain the nodes you are interested in.
  • Added processNodeSubmenu method that gets the submenu that comes up when you click the events button on a process node.
  • Added nodeListElement method. This returns the list of nodes that shows up in the panel. Name is not final.
  • Added nodeListItems method. This returns the list item elements in the node list. Name is not final.
  • Added nodeListNodeLinks method. This returns the links in the items in the node list. Name is not final.
  • Added nodeDetailElement method. This gets the element that contains details about a node. Name is not final.
  • Added nodeDetailBreadcrumbNodeListLink method. Returns the link rendered in the breadcrumbs of the node detail view. Takes the user to the node list. Name is not final.
  • Added nodeDetailViewTitle method. This returns the title of the node detail view. Name is not final.
  • Added nodeDetailDescriptionListEntries method. This returns an entries list of the details in the node detail view. Name is not final
  • Added resolveWrapper method. Pass this a function that returns a ReactWrapper. The method will evaluate the returned wrapper after each event loop and return it once it isn't empty.

Improved our mocks

  • We had a DataAccessLayer and ResolverTree mock named 'one_ancestor_two_childrenthat actually had no ancestors. Renamed them tono_ancestors_two_children`.
  • New DataAccessLayer mock called noAncestorsTwoChildrenWithRelatedEventsOnOrigin

Added new 'clickthrough' suite test

  • Added new test in the 'clickthrough' suite that asserts that a user can click the 'related events' button on a node and see the list of related event categories in the submenu.

Improved the Resolver event model

  • Added timestampAsDateSafeVersion to the event model. This gets a Date object for the timestamp. (We still need make it clear that this model is ResolverSpecific)

New urlSearch test helper.

Use urlSearch when testing Resolver's interaction with the browser location. It calculates the expected 'search' value based on some Resolver specific parameters.

  • Use this to calculate a URL and then populate the memory history with this URL. This will allow you to see if Resolver loads correctly based on the URL state.
  • Use this to calculate the expected URL based on Resolver's current state.

Added new 'panel' test

  • If Resolver is loaded with a url search parameter that selects a node, the node's details are shown in the panel.
  • When a history.push occurs that sets a search parameter that selects a node, the details of that node are shown.
  • Check that the url search is updated when the user interacts with the panel
  • Check that the panel shows the correct details for a node. (except for the timestamp. See TODO)

Changed data-test-subjs

  • Removed resolver:panel. This was used on a wrapper element that we expect to remove soon.
  • Added resolver:node-detail:breadcrumbs:node-list-link for the buttons in the breadcrumb in the panel.
  • Added resolver:node-detail:title for the title element in the node detail view.
  • Added resolver:node-detail:entry-title and resolver:node-detail:entry-description for the details shown about a process in the node detail view.
  • Added resolver:node-list:node-link. This is the link shown for each node in the node list.
  • added resolver:node-list:item to each list item in the node list view.

Removed dead code

  • map.tsx wasn't being used. It was renamed but the old version wasn't deleted.

Improved the node detail view

  • Show the timestamp for a node's process event even if the timestamp is the unix epoch. Note: this is technically a bug fix but the bug is very obscure.
  • Show the PID for a node's process event when the PID is 0. Note: this is a bug fix.

TODO

  • Organize panel tests. Separate the tests into 3 types. First, tests that check that Resolver shows the right stuff in the panel on load based on the query string. Second, tests that check that Resolver sets the correct query string when changing the panel view. Third, tests that check that the contents of the panel are correct in various situations.
  • nodeDetailEntryDescription and nodeDetailEntryTitle methods should be inlined.
  • Remove nodeDetailElement method and resolver:node-detail data test subj.
  • Removed nodeListElement method and resolver:node-list data test subj
  • Write a test to check the desc for the icons.

Tickets to file

  • Use links instead of buttons in the breadcrumb navigation
  • Write guidance on mocking Data Access Layer. Expose metadata statically from the modules that define the mocks.
  • Use links instead of buttons in the node list
  • Use the Kibana ui settings time format. Update tests to check the timestamp values in the UI.
  • Organize data-test-subjs. Write a readme.md with guidance on using these. We are defining these without documenting them. We also create accessor methods in the simulator that have names that are unrelated to the data-test-subj strings. we have no way of finding unused data-test-subjs or unused accessor methods.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@oatkiller oatkiller changed the title Panel tests 2 [Resolver] Improve simulator. Add more click-through tests and panel tests. Aug 10, 2020
@oatkiller oatkiller added Feature:Resolver Security Solution Resolver feature Team:Endpoint Data Visibility Team managing the endpoint resolver v7.10.0 labels Aug 10, 2020
@@ -28,7 +28,6 @@ export const CubeForProcess = memo(function CubeForProcess({
height="1.5em"
viewBox="0 0 1 1"
>
<desc>{descriptionText}</desc>
Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 Since we're communicating meaning with the visual presentation of those cubes, I don't think it's right to remove the desc from that without at least trying to set up some alternative accessible description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i restored the desc

@@ -161,7 +162,7 @@ export const ProcessDetails = memo(function ProcessDetails({
<StyledBreadcrumbs breadcrumbs={crumbs} />
<EuiSpacer size="l" />
<EuiTitle size="xs">
<h4 aria-describedby={titleId}>
<h4 data-test-subj="resolver:node-detail:title" aria-describedby={titleId}>
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ I don't think that's equivalent to what we're (trying?) to communicate with the cube, is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the describedby thing ya mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put the desc back and added some basic tests for them

@@ -124,6 +133,7 @@ export class Simulator {
yield mapper();
await new Promise((resolve) => {
setTimeout(() => {
this.forceAutoSizerOpen();
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ I was thinking you'd just call this when you need it in another public method (like clickRelatedButton) rather than inlining it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Few thoughts on this:

  • AutoSizer provides behavior we don't even want. We'll probably stop using EuiSelectable in 7.10.
  • We may end up accidentally using AutoSizer in the future since we use Eui. Eui could add it in places or we could start using new Eui stuff.
  • This is only needed because of limitations with JSDOM anyway.

With the stuff above in mind:

  • I don't think devs should ever have to think about this in order to write tests
  • Tests shouldn't be coupled to this

All that being said, putting this in map seems to satisfy all the constraints. Any reason why it shouldn't be there?

Copy link
Contributor

Choose a reason for hiding this comment

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

Map is at the center of this 'new approach' to testing. Adding something that only has to be there for some edge-case-set of tests seems like it would

  1. Make the core testing framework harder to read understand
  2. Expose the rig to other weird/unexpected side-effects... maybe for some test in the future, you want that Autosizer behaving nominally vs. being interfered with.

The general idea is that it's a necessary but ugly thing to do, so you should avoid doing it when you can - and injecting it into our Enzyme main event loop makes that hard.

I guess at the very least you should add an additional comment inside the .map so the reader can understand when/why that happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lets save this discussion into a ticket or in-code docs and defer deciding until later.

simulator.processNodeRelatedEventButton(entityIDs.origin)
);
if (button) {
button.simulate('click');
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ Mentioned above, but I had this as a public method on the simulator, like simulator.clickNodeRelatedEventsButton(id)

@@ -16384,7 +16384,7 @@
"xpack.securitySolution.endpoint.resolver.panel.processEventListByType.eventDescriptiveName": "{descriptor} {subject}",
"xpack.securitySolution.endpoint.resolver.panel.processEventListByType.events": "イベント",
"xpack.securitySolution.endpoint.resolver.panel.processEventListByType.wait": "イベントを待機しています...",
"xpack.securitySolution.endpoint.resolver.panel.processListWithCounts.events": "すべてのプロセスイベント",
Copy link
Contributor

Choose a reason for hiding this comment

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

ℹ️ Was this automated or did you do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i did it. turns out changing those things is a pain now.

Copy link
Contributor

Choose a reason for hiding this comment

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

are they going to need to be manually changed from now on then?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this seems like a thing we should cover as a team. 1) What do you do when you change the actual semantics of a translation? Like changing "Terminated Process" to "Terminated Trigger" or something? Do you delete the label and make a new one? 2) Is it safe to reuse these if the semantics are the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. not sure.
Related, we could talk as a team about how to pick IDs.

@oatkiller oatkiller marked this pull request as ready for review August 10, 2020 19:33
@oatkiller oatkiller requested review from a team as code owners August 10, 2020 19:33
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-app-team (Feature:Resolver)

@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-data-visibility-team (Team:Endpoint Data Visibility)

@@ -55,6 +55,21 @@ export function timestampSafeVersion(event: SafeResolverEvent): string | undefin
: firstNonNullValue(event?.['@timestamp']);
}

export function timestampAsDateSafeVersion(event: SafeResolverEvent): Date | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 Doc comment on export.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

Copy link
Contributor

@bkimmel bkimmel left a comment

Choose a reason for hiding this comment

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

I had one additional 🔴 for missing comments, but provided that gets taken care of I'm in with a 👍 here.

*/
private nodeDetailEntryDescription(): ReactWrapper {
return this.domNodes('[data-test-subj="resolver:node-detail:entry-description"]');
public nodeDetailViewTitleIcon(): ReactWrapper {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just making a note here about following the page objects pattern

Copy link
Contributor Author

@oatkiller oatkiller Aug 11, 2020

Choose a reason for hiding this comment

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

What do you mean exactly?

/**
* The details of the selected node are shown in a description list. This returns the title elements of the description list.
*/
const titles = this.domNodes('[data-test-subj="resolver:node-detail:entry-title"]');
Copy link
Contributor

Choose a reason for hiding this comment

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

Node-detail makes me think the information is physically tied with the node in some way in the view rather than in the panel, maybe node-panel-detail? Not really sure if that's necessarily better

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, ignore me. node-detail is fine.

@oatkiller
Copy link
Contributor Author

Reverified after latest commit: 47f0cff

image

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
securitySolution 7.3MB +403.0B 7.3MB

History

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

@oatkiller oatkiller merged commit bd8761e into elastic:master Aug 11, 2020
@oatkiller oatkiller deleted the panel-tests-2 branch August 11, 2020 17:58
oatkiller pushed a commit to oatkiller/kibana that referenced this pull request Aug 11, 2020
…tests. (elastic#74601)

### Improved the simulator.
* Replace `mapStateTransitions` with `map`. The usage and interface are the same, but `map` is not dependent on redux state. This will work for parts of the app that don't use redux (aka EUI). `map` also forces any `AutoSizer` instances used by EUI to show their full contents. `AutoSizer` works but it doesn't behave as expected in JSDOM. With this hack in place, we can bypass `AutoSizer`. Going forward, we should make sure to use something other than `EuiSelectable` for the dropdowns
* Removed the `connectEnzymeWrapperAndStore` test helper. The new `map` simulator method doesn't rely on redux so we no longer need this explicit sync.
* The simulator can receive a memory history instance. This allows tests to pass in a precreated / controlled memory instance. Useful for testing the query string. This design is not final. Instead we could have an 'intiialHistorySearch' parameter that sets the query string on instantiation as well as 'pushHistory' and 'replaceHistory' methods?
* `findInDom` is now called `domNodes`.
* `processNodeElementLooksSelected` and `processNodeElementLooksUnselected` are gone. Instead use `selectedProcessNode` and `unselectedProcessNode` to find the wrappers and  assert that they wrappers contain the nodes you are interested in.
* Added `processNodeSubmenu` method that gets the submenu that comes up when you click the events button on a process node.
* Added `nodeListElement` method. This returns the list of nodes that shows up in the panel. Name is not final.
* Added `nodeListItems` method. This returns the list item elements in the node list. Name is not final.
* Added `nodeListNodeLinks` method. This returns the links in the items in the node list. Name is not final.
* Added `nodeDetailElement` method. This gets the element that contains details about a node. Name is not final.
* Added `nodeDetailBreadcrumbNodeListLink` method. Returns the link rendered in the breadcrumbs of the node detail view. Takes the user to the node list. Name is not final.
* Added `nodeDetailViewTitle` method. This returns the title of the node detail view. Name is not final.
* Added `nodeDetailDescriptionListEntries` method. This returns an entries list of the details in the node detail view. Name is not final
* Added `resolveWrapper` method. Pass this a function that returns a `ReactWrapper`. The method will evaluate the returned wrapper after each event loop and return it once it isn't empty.

### Improved our mocks
* We had a DataAccessLayer and ResolverTree mock named 'one_ancestor_two_children` that actually had no ancestors. Renamed them to `no_ancestors_two_children`.
* New DataAccessLayer mock called `noAncestorsTwoChildrenWithRelatedEventsOnOrigin`

### Added new 'clickthrough' suite test
* Added new test in the 'clickthrough' suite that asserts that a user can click the 'related events' button on a node and see the list of related event categories in the submenu.

### Improved the Resolver event model
* Added `timestampAsDateSafeVersion` to the event model. This gets a `Date` object for the timestamp. (We still need make it clear that this model is ResolverSpecific)

### New `urlSearch` test helper.
Use `urlSearch` when testing Resolver's interaction with the browser location. It calculates the expected 'search' value based on some Resolver specific parameters.
* Use this to calculate a URL and then populate the memory history with this URL. This will allow you to see if Resolver loads correctly based on the URL state.
* Use this to calculate the expected URL based on Resolver's current state.

### Added new 'panel' test
* If Resolver is loaded with a url search parameter that selects a node, the node's details are shown in the panel.
* When a history.push occurs that sets a search parameter that selects a node, the details of that node are shown.
* Check that the url search is updated when the user interacts with the panel
* Check that the panel shows the correct details for a node. (except for the timestamp. See TODO)

### Changed `data-test-subj`s
* Removed `resolver:panel`. This was used on a wrapper element that we expect to remove soon. 
* Added `resolver:node-detail:breadcrumbs:node-list-link` for the buttons in the breadcrumb in the panel.
* Added `resolver:node-detail:title` for the title element in the node detail view.
* Added `resolver:node-detail:entry-title` and `resolver:node-detail:entry-description` for the details shown about a process in the node detail view. 
* Added `resolver:node-list:node-link`. This is the link shown for each node in the node list.
* added `resolver:node-list:item` to each list item in the node list view.

### Removed dead code
* `map.tsx` wasn't being used. It was renamed but the old version wasn't deleted.

### Improved the node detail view
* Show the timestamp for a node's process event even if the timestamp is the unix epoch. Note: this is technically a bug fix but the bug is very obscure. 
* Show the PID for a node's process event when the PID is 0. Note: this is a bug fix.
jloleysens added a commit to jloleysens/kibana that referenced this pull request Aug 12, 2020
…nes/processor-forms-a-d

* 'master' of github.com:elastic/kibana: (25 commits)
  [ML] Removing full lodash library imports (elastic#74742)
  [Search] Server strategy example (elastic#71679)
  [Reporting] Fix and test for Listing of Reports (elastic#74453)
  [maps] fix drawing shapes (elastic#74689)
  [Resolver] Improve simulator. Add more click-through tests and panel tests. (elastic#74601)
  Deprecate schema-less specs in Vega (elastic#73805)
  [Security Solution] Rename Administration > Hosts subtab to Endpoints (elastic#74287)
  Timelion deprecation doc (elastic#74508)
  [Functional Tests] Adds a wait time between setting the index pattern and the time field on TSVB (elastic#74736)
  [Lens] Add styling options for x and y axes on the settings popover (elastic#71829)
  [Maps] add initial location option that fits to data bounds (elastic#74583)
  theme function (elastic#73451)
  [data.ui.query] Write filters to query log from default editor. (elastic#74474)
  [data.search.SearchSource] Move some SearchSource dependencies to the server. (elastic#74607)
  [Canvas][tech-debt] Convert renderers (elastic#74134)
  [security solutions][lists] Adds end to end tests (elastic#74473)
  pluralized for occurrences vs occurrence (elastic#74564)
  Update links that pointed to CONTRIBUTING.md (elastic#74757)
  [Ingest pipelines] Implement tabs in processor flyout (elastic#74469)
  [Event log] Use Alerts client & Actions client when fetching these types of SOs (elastic#73257)
  ...

# Conflicts:
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/field_components/text_editor.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/manage_processor_form.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/append.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/bytes.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/circle.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/field_name_field.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/common_fields/ignore_missing_field.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/convert.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/csv.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/date_index_name.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dissect.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/dot_expander.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/drop.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/index.ts
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_processors_editor/components/manage_processor_form/processors/shared.ts
gmmorris added a commit to gmmorris/kibana that referenced this pull request Aug 12, 2020
* master:
  [Vega] add functional tests for Vega visualization (elastic#74097)
  [ML] Removing full lodash library imports (elastic#74742)
  [Search] Server strategy example (elastic#71679)
  [Reporting] Fix and test for Listing of Reports (elastic#74453)
  [maps] fix drawing shapes (elastic#74689)
  [Resolver] Improve simulator. Add more click-through tests and panel tests. (elastic#74601)
  Deprecate schema-less specs in Vega (elastic#73805)
  [Security Solution] Rename Administration > Hosts subtab to Endpoints (elastic#74287)
  Timelion deprecation doc (elastic#74508)
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 13, 2020
oatkiller pushed a commit that referenced this pull request Aug 13, 2020
…tests. (#74601) (#74791)

### Improved the simulator.
* Replace `mapStateTransitions` with `map`. The usage and interface are the same, but `map` is not dependent on redux state. This will work for parts of the app that don't use redux (aka EUI). `map` also forces any `AutoSizer` instances used by EUI to show their full contents. `AutoSizer` works but it doesn't behave as expected in JSDOM. With this hack in place, we can bypass `AutoSizer`. Going forward, we should make sure to use something other than `EuiSelectable` for the dropdowns
* Removed the `connectEnzymeWrapperAndStore` test helper. The new `map` simulator method doesn't rely on redux so we no longer need this explicit sync.
* The simulator can receive a memory history instance. This allows tests to pass in a precreated / controlled memory instance. Useful for testing the query string. This design is not final. Instead we could have an 'intiialHistorySearch' parameter that sets the query string on instantiation as well as 'pushHistory' and 'replaceHistory' methods?
* `findInDom` is now called `domNodes`.
* `processNodeElementLooksSelected` and `processNodeElementLooksUnselected` are gone. Instead use `selectedProcessNode` and `unselectedProcessNode` to find the wrappers and  assert that they wrappers contain the nodes you are interested in.
* Added `processNodeSubmenu` method that gets the submenu that comes up when you click the events button on a process node.
* Added `nodeListElement` method. This returns the list of nodes that shows up in the panel. Name is not final.
* Added `nodeListItems` method. This returns the list item elements in the node list. Name is not final.
* Added `nodeListNodeLinks` method. This returns the links in the items in the node list. Name is not final.
* Added `nodeDetailElement` method. This gets the element that contains details about a node. Name is not final.
* Added `nodeDetailBreadcrumbNodeListLink` method. Returns the link rendered in the breadcrumbs of the node detail view. Takes the user to the node list. Name is not final.
* Added `nodeDetailViewTitle` method. This returns the title of the node detail view. Name is not final.
* Added `nodeDetailDescriptionListEntries` method. This returns an entries list of the details in the node detail view. Name is not final
* Added `resolveWrapper` method. Pass this a function that returns a `ReactWrapper`. The method will evaluate the returned wrapper after each event loop and return it once it isn't empty.

### Improved our mocks
* We had a DataAccessLayer and ResolverTree mock named 'one_ancestor_two_children` that actually had no ancestors. Renamed them to `no_ancestors_two_children`.
* New DataAccessLayer mock called `noAncestorsTwoChildrenWithRelatedEventsOnOrigin`

### Added new 'clickthrough' suite test
* Added new test in the 'clickthrough' suite that asserts that a user can click the 'related events' button on a node and see the list of related event categories in the submenu.

### Improved the Resolver event model
* Added `timestampAsDateSafeVersion` to the event model. This gets a `Date` object for the timestamp. (We still need make it clear that this model is ResolverSpecific)

### New `urlSearch` test helper.
Use `urlSearch` when testing Resolver's interaction with the browser location. It calculates the expected 'search' value based on some Resolver specific parameters.
* Use this to calculate a URL and then populate the memory history with this URL. This will allow you to see if Resolver loads correctly based on the URL state.
* Use this to calculate the expected URL based on Resolver's current state.

### Added new 'panel' test
* If Resolver is loaded with a url search parameter that selects a node, the node's details are shown in the panel.
* When a history.push occurs that sets a search parameter that selects a node, the details of that node are shown.
* Check that the url search is updated when the user interacts with the panel
* Check that the panel shows the correct details for a node. (except for the timestamp. See TODO)

### Changed `data-test-subj`s
* Removed `resolver:panel`. This was used on a wrapper element that we expect to remove soon. 
* Added `resolver:node-detail:breadcrumbs:node-list-link` for the buttons in the breadcrumb in the panel.
* Added `resolver:node-detail:title` for the title element in the node detail view.
* Added `resolver:node-detail:entry-title` and `resolver:node-detail:entry-description` for the details shown about a process in the node detail view. 
* Added `resolver:node-list:node-link`. This is the link shown for each node in the node list.
* added `resolver:node-list:item` to each list item in the node list view.

### Removed dead code
* `map.tsx` wasn't being used. It was renamed but the old version wasn't deleted.

### Improved the node detail view
* Show the timestamp for a node's process event even if the timestamp is the unix epoch. Note: this is technically a bug fix but the bug is very obscure. 
* Show the PID for a node's process event when the PID is 0. Note: this is a bug fix.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Resolver Security Solution Resolver feature release_note:fix Team:Endpoint Data Visibility Team managing the endpoint resolver v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants