[User Experience] Add error boundary to prevent UX dashboard from crashing the application (#117583)

* wrap UX dashboard into an error boundary (fixes #117543)

* refactor APM root app tests to reuse coreMock

Before this change, the tests for the root application component of the
APM app were manually mocking the `coreStart` objects required to render
the component.

After this change, these tests will now reuse the relevant `coreMock`
methods.

* refactor: fix typo on createAppMountParameters test utility

Co-authored-by: Lucas Fernandes da Costa <lucas.fernandesdacosta@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Lucas F. da Costa 2021-11-08 19:10:59 +00:00 committed by GitHub
parent 635cad4817
commit 1b82502dbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 105 additions and 89 deletions

View file

@ -458,7 +458,7 @@ describe('Plugin', () => {
const [coreStartMock, startDepsMock] = await coreSetup.getStartServices();
const unmountMock = jest.fn();
renderAppMock.mockReturnValue(unmountMock);
const params = coreMock.createAppMountParamters('/fake/base/path');
const params = coreMock.createAppMountParameters('/fake/base/path');
new Plugin(coreMock.createPluginInitializerContext()).setup(coreSetup);
// Grab registered mount function
@ -528,7 +528,7 @@ import { renderApp } from './application';
describe('renderApp', () => {
it('mounts and unmounts UI', () => {
const params = coreMock.createAppMountParamters('/fake/base/path');
const params = coreMock.createAppMountParameters('/fake/base/path');
const core = coreMock.createStart();
// Verify some expected DOM element is rendered into the element
@ -540,7 +540,7 @@ describe('renderApp', () => {
});
it('unsubscribes from uiSettings', () => {
const params = coreMock.createAppMountParamters('/fake/base/path');
const params = coreMock.createAppMountParameters('/fake/base/path');
const core = coreMock.createStart();
// Create a fake Subject you can use to monitor observers
const settings$ = new Subject();
@ -555,7 +555,7 @@ describe('renderApp', () => {
});
it('resets chrome visibility', () => {
const params = coreMock.createAppMountParamters('/fake/base/path');
const params = coreMock.createAppMountParameters('/fake/base/path');
const core = coreMock.createStart();
// Verify stateful Core API was called on mount