[EuiProvider] Fix Response-Stream example (#184253)

## Summary

Fixes needed for getting CI to pass when EUI throws an error if
attempting to render a component without the EuiProvider in the render
tree:

## Detailed description
In https://github.com/elastic/kibana/pull/180819, I will deliver a
change that will cause EUI components to throw an error if the
EuiProvider context is missing. This PR comes in as part of the final
work to get all functional tests passing in an environment where EUI
will throw the error. The tied to the ["Fix 'dark mode' inconsistencies
in Kibana" Epic](https://github.com/elastic/kibana-team/issues/805) has
so far been in preparation for this.

>
[[job]](https://buildkite.com/elastic/kibana-pull-request/builds/211859#018fa751-0f89-4253-bab7-b941897a15e1)
[[logs]](018fa779-eab5-4d08-a948-17a1cd95826e)
FTR Configs 33 / response-stream string stream example navigates to the
example

[[job]](https://buildkite.com/elastic/kibana-pull-request/builds/211859#018fa77a-4796-429d-8165-9c8227307a0e)
[[logs]](018fa788-2ed8-43ab-83c1-b781ae09b1cd)
FTR Configs 33 / response-stream string stream example navigates to the
example

**Reviewers: Please interact with critical paths through the UI
components touched in this PR, ESPECIALLY in terms of testing dark mode
and i18n.**

<img width="1107" alt="image"
src="c0d2ce08-ac35-45a7-8192-0b2256fceb0e">

### 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
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tim Sullivan 2024-05-25 10:03:47 -07:00 committed by GitHub
parent 88511f36d1
commit 61a28e76d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -10,6 +10,7 @@ import * as React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { CoreSetup, CoreStart, AppMountParameters } from '@kbn/core/public';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
import { PLUGIN_NAME } from '../common/constants';
import { ResponseStreamStartPlugins } from './plugin';
import { App } from './containers/app';
@ -41,9 +42,11 @@ export const mount =
]);
const reactElement = (
<KibanaContextProvider services={deps}>
<App />
</KibanaContextProvider>
<KibanaRenderContextProvider {...core}>
<KibanaContextProvider services={deps}>
<App />
</KibanaContextProvider>
</KibanaRenderContextProvider>
);
render(reactElement, element);
return () => unmountComponentAtNode(element);

View file

@ -22,5 +22,6 @@
"@kbn/config-schema",
"@kbn/shared-ux-router",
"@kbn/ml-response-stream",
"@kbn/react-kibana-context-render",
]
}