Skip to content

Commit

Permalink
Fix functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed Nov 18, 2020
1 parent 99163c5 commit c7b55bd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export const getTimeseriesVisRenderer: (deps: {
const showNoResult = !checkIfDataExists(config.visData, config.visParams);

render(
<VisualizationContainer handlers={handlers} showNoResult={showNoResult}>
<VisualizationContainer
data-test-subj="timeseriesVis"
handlers={handlers}
showNoResult={showNoResult}
>
<TimeseriesVisualization
dateFormat={uiSettings.get('dateFormat')}
getConfig={uiSettings.get}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ import { VisualizationNoResults } from './visualization_noresults';
import { IInterpreterRenderHandlers } from '../../../expressions/common';

interface VisualizationContainerProps {
'data-test-subj'?: string;
className?: string;
children: ReactNode;
handlers: IInterpreterRenderHandlers;
showNoResult?: boolean;
}

export const VisualizationContainer = ({
'data-test-subj': dataTestSubj = '',
className,
children,
handlers,
Expand All @@ -45,7 +47,7 @@ export const VisualizationContainer = ({
);

return (
<div className={classes}>
<div data-test-subj={dataTestSubj} className={classes}>
<Suspense fallback={fallBack}>
{showNoResult ? <VisualizationNoResults onInit={() => handlers.done()} /> : children}
</Suspense>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class VisualizationNoResults extends React.Component<VisualizationNoResul

public render() {
return (
<div className="visError" ref={this.containerDiv}>
<div data-test-subj="visNoResult" className="visError" ref={this.containerDiv}>
<div className="item top" />
<div className="item">
<EuiText size="xs" color="subdued">
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/dashboard_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function ({ getService, getPageObjects }) {
});

it('tsvb time series shows no data message', async () => {
expect(await testSubjects.exists('noTSVBDataMessage')).to.be(true);
expect(await testSubjects.exists('timeseriesVis > visNoResult')).to.be(true);
});

it('metric value shows no data', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/visual_builder_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro

public async checkPreviewIsDisabled(): Promise<void> {
log.debug(`Check no data message is present`);
await testSubjects.existOrFail('noTSVBDataMessage', { timeout: 5000 });
await testSubjects.existOrFail('timeseriesVis > visNoResult', { timeout: 5000 });
}

public async cloneSeries(nth: number = 0): Promise<void> {
Expand Down

0 comments on commit c7b55bd

Please sign in to comment.