Skip to content

Commit fb72f54

Browse files
add skip tags to test-runner config and stories
1 parent b9f020b commit fb72f54

File tree

29 files changed

+104
-103192
lines changed

29 files changed

+104
-103192
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,7 @@
18571857
"pirates": "^4.0.1",
18581858
"piscina": "^3.2.0",
18591859
"pixelmatch": "^5.3.0",
1860-
"playwright": "1.49.0",
1860+
"playwright": "1.51.1",
18611861
"playwright-chromium": "1.49.0",
18621862
"pngjs": "^7.0.0",
18631863
"postcss": "^8.4.31",
@@ -1917,4 +1917,4 @@
19171917
"yarn-deduplicate": "^6.0.2"
19181918
},
19191919
"packageManager": "yarn@1.22.21"
1920-
}
1920+
}

x-pack/solutions/observability/plugins/apm/.storybook/test-runner.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
17
import type { TestRunnerConfig } from '@storybook/test-runner';
28
import { injectAxe, checkA11y } from 'axe-playwright';
39

@@ -6,6 +12,11 @@ import { injectAxe, checkA11y } from 'axe-playwright';
612
* to learn more about the test-runner hooks API.
713
*/
814
const config: TestRunnerConfig = {
15+
tags: {
16+
// include: ['test-only', 'pages'],
17+
// exclude: ['no-tests', 'tokens'],
18+
skip: ['skip-test', 'layout'],
19+
},
920
async preVisit(page) {
1021
await injectAxe(page);
1122
},
@@ -18,5 +29,5 @@ const config: TestRunnerConfig = {
1829
});
1930
},
2031
};
21-
32+
// eslint-disable-next-line import/no-default-export
2233
export default config;

x-pack/solutions/observability/plugins/apm/public/components/app/error_group_details/distribution/index.stories.tsx

Lines changed: 73 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,86 +5,94 @@
55
* 2.0.
66
*/
77

8-
import type { ComponentType } from 'react';
8+
import type { ComponentProps } from 'react';
99
import React from 'react';
10+
import type { Meta, StoryObj } from '@storybook/react';
1011
import { ErrorDistribution } from '.';
1112
import { MockApmPluginStorybook } from '../../../../context/apm_plugin/mock_apm_plugin_storybook';
1213
import { FETCH_STATUS } from '../../../../hooks/use_fetcher';
1314

14-
export default {
15+
type Args = ComponentProps<typeof ErrorDistribution>;
16+
17+
const stories: Meta<Args> = {
1518
title: 'app/ErrorGroupDetails/distribution',
1619
component: ErrorDistribution,
20+
tags: ['skip-test'],
1721
decorators: [
18-
(Story: ComponentType) => {
22+
(StoryComponent) => {
1923
return (
2024
<MockApmPluginStorybook routePath="/services/{serviceName}/errors/{groupId}?kuery=&rangeFrom=now-15m&rangeTo=now&environment=ENVIRONMENT_ALL&serviceGroup=&comparisonEnabled=true&transactionType=request&offset=1d">
21-
<Story />
25+
<StoryComponent />
2226
</MockApmPluginStorybook>
2327
);
2428
},
2529
],
2630
};
2731

28-
export function Example() {
29-
const distribution = {
30-
bucketSize: 62350,
31-
currentPeriod: [
32-
{ x: 1624279912350, y: 6 },
33-
{ x: 1624279974700, y: 1 },
34-
{ x: 1624280037050, y: 2 },
35-
{ x: 1624280099400, y: 3 },
36-
{ x: 1624280161750, y: 13 },
37-
{ x: 1624280224100, y: 1 },
38-
{ x: 1624280286450, y: 2 },
39-
{ x: 1624280348800, y: 0 },
40-
{ x: 1624280411150, y: 4 },
41-
{ x: 1624280473500, y: 4 },
42-
{ x: 1624280535850, y: 1 },
43-
{ x: 1624280598200, y: 4 },
44-
{ x: 1624280660550, y: 0 },
45-
{ x: 1624280722900, y: 2 },
46-
{ x: 1624280785250, y: 3 },
47-
{ x: 1624280847600, y: 0 },
48-
],
49-
previousPeriod: [
50-
{ x: 1624279912350, y: 6 },
51-
{ x: 1624279974700, y: 1 },
52-
{ x: 1624280037050, y: 2 },
53-
{ x: 1624280099400, y: 3 },
54-
{ x: 1624280161750, y: 13 },
55-
{ x: 1624280224100, y: 1 },
56-
{ x: 1624280286450, y: 2 },
57-
{ x: 1624280348800, y: 0 },
58-
{ x: 1624280411150, y: 4 },
59-
{ x: 1624280473500, y: 4 },
60-
{ x: 1624280535850, y: 1 },
61-
{ x: 1624280598200, y: 4 },
62-
{ x: 1624280660550, y: 0 },
63-
{ x: 1624280722900, y: 2 },
64-
{ x: 1624280785250, y: 3 },
65-
{ x: 1624280847600, y: 0 },
66-
],
67-
};
32+
export default stories;
6833

69-
return (
70-
<ErrorDistribution
71-
fetchStatus={FETCH_STATUS.SUCCESS}
72-
distribution={distribution}
73-
title="Foo title"
74-
/>
75-
);
76-
}
34+
export const Example: StoryObj<Args> = {
35+
render: (args) => {
36+
return <ErrorDistribution {...args} />;
37+
},
38+
args: {
39+
distribution: {
40+
bucketSize: 62350,
41+
currentPeriod: [
42+
{ x: 1624279912350, y: 6 },
43+
{ x: 1624279974700, y: 1 },
44+
{ x: 1624280037050, y: 2 },
45+
{ x: 1624280099400, y: 3 },
46+
{ x: 1624280161750, y: 13 },
47+
{ x: 1624280224100, y: 1 },
48+
{ x: 1624280286450, y: 2 },
49+
{ x: 1624280348800, y: 0 },
50+
{ x: 1624280411150, y: 4 },
51+
{ x: 1624280473500, y: 4 },
52+
{ x: 1624280535850, y: 1 },
53+
{ x: 1624280598200, y: 4 },
54+
{ x: 1624280660550, y: 0 },
55+
{ x: 1624280722900, y: 2 },
56+
{ x: 1624280785250, y: 3 },
57+
{ x: 1624280847600, y: 0 },
58+
],
59+
previousPeriod: [
60+
{ x: 1624279912350, y: 6 },
61+
{ x: 1624279974700, y: 1 },
62+
{ x: 1624280037050, y: 2 },
63+
{ x: 1624280099400, y: 3 },
64+
{ x: 1624280161750, y: 13 },
65+
{ x: 1624280224100, y: 1 },
66+
{ x: 1624280286450, y: 2 },
67+
{ x: 1624280348800, y: 0 },
68+
{ x: 1624280411150, y: 4 },
69+
{ x: 1624280473500, y: 4 },
70+
{ x: 1624280535850, y: 1 },
71+
{ x: 1624280598200, y: 4 },
72+
{ x: 1624280660550, y: 0 },
73+
{ x: 1624280722900, y: 2 },
74+
{ x: 1624280785250, y: 3 },
75+
{ x: 1624280847600, y: 0 },
76+
],
77+
},
78+
fetchStatus: FETCH_STATUS.SUCCESS,
79+
title: 'Foo title',
80+
},
81+
tags: ['skip-test'],
82+
};
7783

78-
export function EmptyState() {
79-
return (
80-
<ErrorDistribution
81-
fetchStatus={FETCH_STATUS.SUCCESS}
82-
distribution={{
83-
bucketSize: 10,
84-
currentPeriod: [],
85-
previousPeriod: [],
86-
}}
87-
title="Foo title"
88-
/>
89-
);
90-
}
84+
export const EmptyState: StoryObj<Args> = {
85+
render: (args) => {
86+
return <ErrorDistribution {...args} />;
87+
},
88+
args: {
89+
fetchStatus: FETCH_STATUS.SUCCESS,
90+
distribution: {
91+
bucketSize: 10,
92+
currentPeriod: [],
93+
previousPeriod: [],
94+
},
95+
title: 'Foo title',
96+
},
97+
tags: ['skip-test'],
98+
};

x-pack/solutions/observability/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type Args = ComponentProps<typeof ErrorGroupList>;
1818
const stories: Meta<Args> = {
1919
title: 'app/ErrorGroupOverview/ErrorGroupList',
2020
component: ErrorGroupList,
21+
tags: ['skip-test'],
2122
decorators: [
2223
(StoryComponent, { args }) => {
2324
const coreMock = {
@@ -110,7 +111,7 @@ export const Example: StoryObj<Args> = {
110111
render: (args) => {
111112
return <ErrorGroupList {...args} />;
112113
},
113-
114+
tags: ['skip-test'],
114115
args: {
115116
serviceName: 'test service',
116117
initialPageSize: 5,

x-pack/solutions/observability/plugins/apm/public/components/app/service_inventory/service_inventory.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { FETCH_STATUS } from '../../../hooks/use_fetcher';
1818
const stories: Meta<{}> = {
1919
title: 'app/ServiceInventory',
2020
component: ServiceInventory,
21+
tags: ['skip-test'],
2122
decorators: [
2223
(StoryComponent) => {
2324
const coreMock = {

x-pack/solutions/observability/plugins/apm/public/components/app/service_overview/service_overview.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { mockApmApiCallResponse } from '../../../services/rest/call_apm_api_spy'
1717
const stories: Meta<{}> = {
1818
title: 'app/ServiceOverview',
1919
component: ServiceOverview,
20+
tags: ['skip-test'],
2021
decorators: [
2122
(StoryComponent) => {
2223
const serviceName = 'testServiceName';

x-pack/solutions/observability/plugins/apm/public/components/app/settings/agent_keys/create_agent_key.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ type Args = ComponentProps<typeof CreateAgentKeyFlyout>;
1515
const stories: Meta<Args> = {
1616
title: 'app/Settings/AgentKeys/CreateAgentKeyFlyout',
1717
component: CreateAgentKeyFlyout,
18+
tags: ['skip-test'],
1819
};
1920
export default stories;
2021

2122
export const Example: StoryObj<Args> = {
23+
tags: ['skip-test'],
2224
render: (args) => {
2325
return <CreateAgentKeyFlyout {...args} />;
2426
},

x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/transaction_flyout/transaction_flyout.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const data = generateData();
5555
export default {
5656
title: 'app/TransactionDetails/waterfall/TransactionFlyout',
5757
component: TransactionFlyout,
58+
tags: ['skip-test'],
5859
decorators: [
5960
(StoryComponent: ComponentType) => {
6061
const coreMock = {

x-pack/solutions/observability/plugins/apm/public/components/shared/license_prompt/license_prompt.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const contextMock = {
1818
export default {
1919
title: 'shared/LicensePrompt',
2020
component: LicensePrompt,
21+
tags: ['skip-test'],
2122
decorators: [
2223
(Story: ComponentType) => (
2324
<ApmPluginContext.Provider value={contextMock}>

0 commit comments

Comments
 (0)