Device manager - device tile main click target (#9409)

* change device tile click to toggle details instead of selection

* lint

* test current device section click

* stuck cypress
This commit is contained in:
Kerry
2022-10-14 12:43:20 +01:00
committed by GitHub
parent 77543b32d4
commit 17fce6ccb2
14 changed files with 69 additions and 22 deletions
@@ -30,6 +30,7 @@ describe('<SelectableDeviceTile />', () => {
deviceType: DeviceType.Unknown,
};
const defaultProps = {
onSelect: jest.fn(),
onClick: jest.fn(),
device,
children: <div>test</div>,
@@ -48,15 +49,15 @@ describe('<SelectableDeviceTile />', () => {
expect(container.querySelector(`#device-tile-checkbox-${device.device_id}`)).toMatchSnapshot();
});
it('calls onClick on checkbox click', () => {
const onClick = jest.fn();
const { container } = render(getComponent({ onClick }));
it('calls onSelect on checkbox click', () => {
const onSelect = jest.fn();
const { container } = render(getComponent({ onSelect }));
act(() => {
fireEvent.click(container.querySelector(`#device-tile-checkbox-${device.device_id}`));
});
expect(onClick).toHaveBeenCalled();
expect(onSelect).toHaveBeenCalled();
});
it('calls onClick on device tile info click', () => {