1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Change check{User|Device}Trust interfaces

...to return objects with functions rather than a bitmask
This commit is contained in:
David Baker
2019-11-15 12:15:13 +00:00
parent ce2d1d6e2b
commit e541b96a71
5 changed files with 201 additions and 90 deletions

View File

@@ -318,9 +318,17 @@ describe("SAS verification", function() {
await verifyProm;
expect(alice.client.checkDeviceTrust("@bob:example.com", "Dynabook")).toBe(1);
expect(bob.client.checkUserTrust("@alice:example.com")).toBe(6);
expect(bob.client.checkDeviceTrust("@alice:example.com", "Osborne2")).toBe(1);
const bobDeviceTrust = alice.client.checkDeviceTrust("@bob:example.com", "Dynabook");
expect(bobDeviceTrust.isLocallyVerified()).toBeTruthy();
expect(bobDeviceTrust.isCrossSigningVerified()).toBeFalsy();
const aliceTrust = bob.client.checkUserTrust("@alice:example.com");
expect(aliceTrust.isCrossSigningVerified()).toBeTruthy();
expect(aliceTrust.isTofu()).toBeTruthy();
const aliceDeviceTrust = bob.client.checkDeviceTrust("@alice:example.com", "Osborne2");
expect(aliceDeviceTrust.isLocallyVerified()).toBeTruthy();
expect(aliceDeviceTrust.isCrossSigningVerified()).toBeFalsy();
});
});