The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.test.tsx

32 lines
773 B

import { render } from '@testing-library/react';
import React from 'react';
import { dateTime, TimeRange } from '@grafana/data';
import { TimeRangePicker } from './TimeRangePicker';
const from = dateTime('2019-12-17T07:48:27.433Z');
const to = dateTime('2019-12-18T07:48:27.433Z');
const value: TimeRange = {
from,
to,
raw: { from, to },
};
describe('TimePicker', () => {
it('renders buttons correctly', () => {
const container = render(
<TimeRangePicker
onChangeTimeZone={() => {}}
onChange={(value) => {}}
value={value}
onMoveBackward={() => {}}
onMoveForward={() => {}}
onZoom={() => {}}
/>
);
expect(container.queryByLabelText(/Time range selected/i)).toBeInTheDocument();
});
});