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/public/app/features/explore/TimeSyncButton.test.tsx

19 lines
644 B

import React from 'react';
import { TimeSyncButton } from './TimeSyncButton';
import { mount } from 'enzyme';
const setup = (isSynced: boolean) => {
const onClick = () => {};
return mount(<TimeSyncButton onClick={onClick} isSynced={isSynced} />);
};
describe('TimeSyncButton', () => {
it('should change style when synced', () => {
const wrapper = setup(true);
expect(wrapper.find('button').props()['aria-label']).toEqual('Synced times');
});
it('should not change style when not synced', () => {
const wrapper = setup(false);
expect(wrapper.find('button').props()['aria-label']).toEqual('Unsynced times');
});
});