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
@@ -67,6 +67,23 @@ describe('<CurrentDeviceSection />', () => {
expect(container).toMatchSnapshot();
});
it('displays device details on main tile click', () => {
const { getByTestId, container } = render(getComponent({ device: alicesUnverifiedDevice }));
act(() => {
fireEvent.click(getByTestId(`device-tile-${alicesUnverifiedDevice.device_id}`));
});
expect(container.getElementsByClassName('mx_DeviceDetails').length).toBeTruthy();
act(() => {
fireEvent.click(getByTestId(`device-tile-${alicesUnverifiedDevice.device_id}`));
});
// device details are hidden
expect(container.getElementsByClassName('mx_DeviceDetails').length).toBeFalsy();
});
it('displays device details on toggle click', () => {
const { container, getByTestId } = render(getComponent({ device: alicesUnverifiedDevice }));