Skip to content

Commit

Permalink
fix customize time range displays auto-refresh option (#122167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant authored Dec 30, 2021
1 parent 828321c commit 13e2a81
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React from 'react';
import { render, screen } from '@testing-library/react';
import { CustomizeTimeRangeModal } from './customize_time_range_modal';
import { Embeddable } from '../../../../src/plugins/embeddable/public';
import { TimeRangeInput } from './custom_time_range_action';

test("Doesn't display refresh interval options", () => {
render(
<CustomizeTimeRangeModal
embeddable={
{
getInput: () => ({ timerange: { from: 'now-7d', to: 'now' } }),
} as unknown as Embeddable<TimeRangeInput>
}
onClose={() => {}}
commonlyUsedRanges={[]}
/>
);

expect(screen.getByTestId('superDatePickerToggleQuickMenuButton')).toBeInTheDocument();
expect(screen.queryByTitle(/auto refresh/gi)).not.toBeInTheDocument();
});
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export class CustomizeTimeRangeModal extends Component<CustomizeTimeRangeProps,
<EuiSuperDatePicker
start={this.state.timeRange ? this.state.timeRange.from : undefined}
end={this.state.timeRange ? this.state.timeRange.to : undefined}
isPaused={false}
onTimeChange={this.onTimeChange}
showUpdateButton={false}
dateFormat={this.props.dateFormat}
Expand Down

0 comments on commit 13e2a81

Please sign in to comment.