Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add VRTs of specific test failures #1922

Merged
merged 4 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions e2e/tests/interactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,11 @@ test.describe('Interactions', () => {
},
);
});
// currently wrong due to https://github.com/elastic/elastic-charts/issues/1921
test('highlighter zIndex should respect geometry zIndex', async ({ page }) => {
await common.expectChartWithMouseAtUrlToMatchScreenshot(page)(
'http://localhost:9001/?path=/story/test-cases--highlighter-z-index',
{ left: 247, top: 76 }, // mouse over the second point
);
});
});
53 changes: 53 additions & 0 deletions storybook/stories/axes/15_integers_only.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { boolean, number } from '@storybook/addon-knobs';
import React from 'react';

import {
AreaSeries,
Axis,
Chart,
Position,
ScaleType,
Settings,
niceTimeFormatter,
RecursivePartial,
AxisStyle,
BarSeries,
} from '@elastic/charts';
import { KIBANA_METRICS } from '@elastic/charts/src/utils/data_samples/test_dataset_kibana';

import { useBaseTheme } from '../../use_base_theme';

export const Example = () => {
return (
<Chart>
<Settings baseTheme={useBaseTheme()} />
<Axis id="bottom" position={Position.Bottom} />
<Axis id="left" position={Position.Left} integersOnly />

<BarSeries
id="Thermal changes"
xScaleType={ScaleType.Ordinal}
yScaleType={ScaleType.Linear}
xAccessor={0}
yAccessors={[1]}
data={[
['Sensor 1', 0.2],
['Sensor 2', 0.8],
['Sensor 3', 0.76],
['Sensor 4', 0.12],
]}
/>
</Chart>
);
};
Example.parameters = {
markdown: 'Currently not correctly rendered due to [#1920](https://github.com/elastic/elastic-charts/issues/1920)',
};
1 change: 1 addition & 0 deletions storybook/stories/axes/axes.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export { Example as basic } from './1_basic.story';
export { Example as tickLabelRotation } from './2_tick_label_rotation.story';
export { Example as with4Axes } from './3_axis_4_axes.story';
export { Example as multiAxes } from './4_multi_axis.story';
export { Example as showOnlyIntegers } from './15_integers_only.story';
export { Example as barsAndLines } from './5_multi_axis_bar_lines.story';
export { Example as differentTooltip } from './6_different_tooltip.story';
export { Example as differentTooltipFormatter } from './6a_different_tooltip_formatter.story';
Expand Down
54 changes: 54 additions & 0 deletions storybook/stories/test_cases/20_highlighter_z_index.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';

import { Axis, Chart, LineSeries, Position, ScaleType, Settings } from '@elastic/charts';

import { useBaseTheme } from '../../use_base_theme';

export const Example = () => {
return (
<Chart>
<Settings baseTheme={useBaseTheme()} showLegend />
<Axis id="bottom" position={Position.Bottom} />
<Axis id="left" position={Position.Left} />

<LineSeries
id="Sensor 1"
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Linear}
xAccessor={0}
yAccessors={[1]}
data={[
[0, 1],
[1, 0.8],
[2, 0.5],
[3, 0.12],
]}
/>
<LineSeries
id="Sensor 2"
xScaleType={ScaleType.Linear}
yScaleType={ScaleType.Linear}
xAccessor={0}
yAccessors={[1]}
data={[
[0, 1],
[1, 0.8],
[2, 0.76],
[3, 0.12],
]}
/>
</Chart>
);
};

Example.parameters = {
markdown: 'Currently not correctly rendered due to [#1921](https://github.com/elastic/elastic-charts/issues/1921)',
};
1 change: 1 addition & 0 deletions storybook/stories/test_cases/test_cases.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export { Example as accessibilityCustomizations } from './6_a11y_custom_descript
export { Example as rtlText } from './7_rtl_text.story';
export { Example as testPointsOutsideOfDomain } from './8_test_points_outside_of_domain.story';
export { Example as duplicateLabelsInPartitionLegend } from './9_duplicate_labels_in_partition_legend.story';
export { Example as highlighterZIndex } from './20_highlighter_z_index.story';