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

[Uptime] Fix breadcrumb for link back to monitor from waterfall page #87125

Merged
merged 4 commits into from
Jan 4, 2021

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Jan 4, 2021

Summary

Resolves: #86617
Fix breadcrumb for link back to monitor from waterfall page

image

@shahzad31 shahzad31 added release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v7.12.0 v8.0.0 labels Jan 4, 2021
@shahzad31 shahzad31 marked this pull request as ready for review January 4, 2021 13:58
@shahzad31 shahzad31 requested a review from a team as a code owner January 4, 2021 13:58
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
uptime 566 567 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
uptime 1.0MB 1.0MB +2.4KB

Distributable file count

id before after diff
default 47264 48024 +760

History

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

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

Looks great! Just a question about testing.


mountWithRouter(
<MountWithReduxProvider>
<KibanaContextProvider services={{ ...core }}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any helpers available for this type of wrapper? I know that in Observability, there is a test helper that includes these wrappers for react-testing-library. It seems like these wrappers are pretty common in Uptime tests, so a helper would be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no standard here, each developer just uses everything they seems fit, it's has been on my todo list to simplify the helper we have in uptime

x-pack/plugins/uptime/public/lib/helper/helper_with_router.tsx

Copy link
Contributor

Choose a reason for hiding this comment

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

Andrew was concerned about this on one of my PRs during the break. Should we make an issue to cover this? Perhaps I can take a look at it since I may have less context to work on some of the larger bugs popping up for 7.11. It would be great if the helper was not opinionated, working only with a specific testing library, but rather spit out a component to be rendered with whatever library we choose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sure, that would be very nice. Just create an issue and go ahead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dominiqueclarke for wrapper ideally i think we should use https://enzymejs.github.io/enzyme/docs/api/shallow.html#arguments

wrappingComponent prop, that means that part will also not go into snapshot and most use cases can be covered by shallow rendering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anyway, let's continue this discussion in proper issue.

</MountWithReduxProvider>
);

expect(getBreadcrumbs()).toMatchInlineSnapshot(`
Copy link
Contributor

Choose a reason for hiding this comment

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

Another option could be to use react testing library to grab each breadcrumb element by text ("Uptime"), and check that the href is the expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about this now, I'm realizing I'm wrong, since this is testing the output of the hook, not a specific render. Would the breadcrumbs html be rendered at all in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so breadcrumb are rendered outside uptime app, so testing via that means we will have to mount the whole app.

@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Jan 4, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

Looks great! Just hoping we can continue the conversation re: testing utils!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.11.0 v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Uptime] Synthetics: Breadcrumb link back to list of checks is not working
4 participants