Only display bulk unverified sessions nag when current session is verified (PSG-893) (#9656)
* test bulk unverified sessions toast behaviour * unverified sessions toast text tweak * only show bulk unverified sessions toast when current device is verified * add more assertions for show/hide toast, fix strict errors * fix strict error * really fix strict error
This commit is contained in:
parent
8996bf0a7f
commit
5742c24114
4 changed files with 18 additions and 9 deletions
|
@ -414,11 +414,16 @@ describe('DeviceListener', () => {
|
|||
expect(BulkUnverifiedSessionsToast.showToast).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('hides toast when only unverified device is the current device', async () => {
|
||||
mockClient!.getStoredDevicesForUser.mockReturnValue([
|
||||
currentDevice,
|
||||
]);
|
||||
mockClient!.checkDeviceTrust.mockReturnValue(deviceTrustUnverified);
|
||||
it('hides toast when current device is unverified', async () => {
|
||||
// device2 verified, current and device3 unverified
|
||||
mockClient!.checkDeviceTrust.mockImplementation((_userId, deviceId) => {
|
||||
switch (deviceId) {
|
||||
case device2.deviceId:
|
||||
return deviceTrustVerified;
|
||||
default:
|
||||
return deviceTrustUnverified;
|
||||
}
|
||||
});
|
||||
await createAndStart();
|
||||
expect(BulkUnverifiedSessionsToast.hideToast).toHaveBeenCalled();
|
||||
expect(BulkUnverifiedSessionsToast.showToast).not.toHaveBeenCalled();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue