mirror of
https://github.com/grafana/grafana.git
synced 2025-01-15 19:22:34 -06:00
6dbb803b3f
* Transformations: enable queries reorder by drag and drop * Satisfy ts * Update unicons and replace ellipsis with draggabledot * remove import * Remove that snap * Review * review 2
20 lines
644 B
TypeScript
20 lines
644 B
TypeScript
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');
|
|
});
|
|
});
|