Commit graph

11 commits

Author SHA1 Message Date
Nathan L Smith efa4ce22fa
Storybook EUI theme decorator (#103582)
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).
2021-07-09 08:54:48 -05:00
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00
Dario Gieselaar 213b934386
[APM] Make sure jest script can be run from anywhere (#85111) 2020-12-08 07:55:24 +01:00
Tyler Smalley b593781009
Jest multi-project configuration (#77894)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-02 11:42:23 -08:00
Nathan L Smith 3714658760
Transaction type handling and breakdown chart (#83587) 2020-11-24 13:37:24 +01:00
Søren Louv-Jansen a703524853
[APM] Only fetch custom links for users with a valid license (#83836)
* [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
2020-11-20 19:59:30 +01:00
Dario Gieselaar 66def097ad
[APM] Ensure APM jest script can run (#83398) 2020-11-16 11:54:57 +01:00
Nathan L Smith 585b3f7e3d
Add Jest configuration and README to observability plugin (#70340)
Also clean up the coverage configuration in the APM jest config.
2020-06-30 14:03:05 -05:00
Thomas Watson ad01223c5a
chore: improve support for mjs file extension (#70186) 2020-06-30 16:13:28 +02:00
Nathan L Smith 2e3578602f
APM Storybook fixes (#68671)
* 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.
2020-06-09 16:17:28 -05:00
Nathan L Smith 78d5026fbd
APM-specific Jest configuration (#67858)
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.
2020-06-01 20:38:53 -05:00