Add an `EuiThemeProviderDecorator` to kibanaReact which uses the Storybook globals to set the EUI theme.
Add global decorators to the APM and Observability plugins so all stories are wrapped in the `EuiThemeProviderDecorator`, and they don't need to specify it in the stories.
Add [jest setup helpers recommended by @storybook/testing-react](https://github.com/storybookjs/testing-react#global-config).
* [APM] Only fetch custom links when user has valid license
* Rename more files for consistency
* i18n fixes
* Fix tests
* Addess feedback and minor cleanup
* Fix test (and more cleanup)
* Make cachable
* Resolve core legacy assets in @kbn/storybook webpack configuration
* Ignore stories in Jest coverage
* Combine effects in Cytoscape component so handlers are always added before events are triggered
* Add mock context to ErrorRateAlertTrigger stories
* Disable TransactionDurationAlertTrigger stories
Changing the Cytoscape effect behavior is necessary because the layout was not being triggered when the final set of elements is provided as props to the component. When this is used in Kibana we're always starting with empty elements and fetching them, but in the Storybook we're starting out with the full elements.
Update the x-pack `createJestConfig` function to take the `rootDir` as an argument, which allows for easier overriding of the Jest configuration for a specific directory.
Previously we would run Jest in development from the x-pack directory by running something like:
```
node scripts/jest.js --testPathPattern=plugins/apm --watch
```
Currently (for me anyway) this is failing with:
```
Error: EMFILE: too many open files, watch
at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
```
and it would sometimes not correctly test only the changed files when a change in APM was made. It was also difficult to configure correctly with the [VSCode Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest).
Add a jest.config.js for APM. This makes running with `--watch` better about which files it chooses to re-run and makes the VSCode extension work (including coverage mapping) with minimal configuration.