1import React from 'react';
2import { TimeSyncButton } from './TimeSyncButton';
3import { mount } from 'enzyme';
4
5const setup = (isSynced: boolean) => {
6  const onClick = () => {};
7  return mount(<TimeSyncButton onClick={onClick} isSynced={isSynced} />);
8};
9
10describe('TimeSyncButton', () => {
11  it('should change style when synced', () => {
12    const wrapper = setup(true);
13    expect(wrapper.find('button').props()['aria-label']).toEqual('Synced times');
14  });
15  it('should not change style when not synced', () => {
16    const wrapper = setup(false);
17    expect(wrapper.find('button').props()['aria-label']).toEqual('Unsynced times');
18  });
19});
20