-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix customize time range displays auto-refresh option (#122167)
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/ui_actions_enhanced/public/customize_time_range_modal.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters