Skip to content

Commit

Permalink
start fixing transaction duration alert trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed Jul 13, 2021
1 parent 9603301 commit c9d13b2
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { Story } from '@storybook/react';
import { cloneDeep, merge } from 'lodash';
import React, { ComponentType } from 'react';
import { MemoryRouter, Route } from 'react-router-dom';
Expand All @@ -20,7 +21,7 @@ export default {
title: 'alerting/TransactionDurationAlertTrigger',
component: TransactionDurationAlertTrigger,
decorators: [
(Story: ComponentType) => {
(StoryComponent: ComponentType) => {
const contextMock = (merge(cloneDeep(mockApmPluginContextValue), {
core: {
http: {
Expand All @@ -39,11 +40,11 @@ export default {

return (
<div style={{ width: 400 }}>
<MemoryRouter initialEntries={['/transactions/test-service-name']}>
<Route path="/transactions/:serviceName">
<MemoryRouter initialEntries={['/services/test-service-name']}>
<Route path="/services/:serviceName">
<MockApmPluginContextWrapper value={contextMock}>
<MockUrlParamsContextProvider>
<Story />
<StoryComponent />
</MockUrlParamsContextProvider>
</MockApmPluginContextWrapper>
</Route>
Expand All @@ -54,7 +55,7 @@ export default {
],
};

export function Example() {
export const Example: Story = () => {
const params = {
threshold: 1500,
aggregationType: 'avg' as const,
Expand All @@ -67,4 +68,4 @@ export function Example() {
setAlertProperty={() => undefined}
/>
);
}
};

0 comments on commit c9d13b2

Please sign in to comment.