grafana/public/app/features/explore/TimeSyncButton.test.tsx
Dominik Prokop 6dbb803b3f
Transformations: enable transformations reordering (#27197)
* 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
2020-08-31 08:47:27 +02:00

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');
});
});