forked from grafana.jool/grafana-jool
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.
19 lines
644 B
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');
|
|
});
|
|
});
|
|
|