Display push toggle for web sessions (MSC3890) (#9327)
This commit is contained in:
parent
e15ef9f3de
commit
c3bfb6e4a9
8 changed files with 166 additions and 33 deletions
|
@ -33,7 +33,7 @@ describe('<DeviceDetails />', () => {
|
|||
isLoading: false,
|
||||
onSignOutDevice: jest.fn(),
|
||||
saveDeviceName: jest.fn(),
|
||||
setPusherEnabled: jest.fn(),
|
||||
setPushNotifications: jest.fn(),
|
||||
supportsMSC3881: true,
|
||||
};
|
||||
|
||||
|
@ -157,6 +157,27 @@ describe('<DeviceDetails />', () => {
|
|||
|
||||
fireEvent.click(checkbox);
|
||||
|
||||
expect(defaultProps.setPusherEnabled).toHaveBeenCalledWith(device.device_id, !enabled);
|
||||
expect(defaultProps.setPushNotifications).toHaveBeenCalledWith(device.device_id, !enabled);
|
||||
});
|
||||
|
||||
it('changes the local notifications settings status when clicked', () => {
|
||||
const device = {
|
||||
...baseDevice,
|
||||
};
|
||||
|
||||
const enabled = false;
|
||||
|
||||
const { getByTestId } = render(getComponent({
|
||||
device,
|
||||
localNotificationSettings: {
|
||||
is_silenced: !enabled,
|
||||
},
|
||||
isSigningOut: true,
|
||||
}));
|
||||
|
||||
const checkbox = getByTestId('device-detail-push-notification-checkbox');
|
||||
fireEvent.click(checkbox);
|
||||
|
||||
expect(defaultProps.setPushNotifications).toHaveBeenCalledWith(device.device_id, !enabled);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue