1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Fix some broken tests

A number of the tests appear to have been broken since 90c919e without anyone
noticing; fix them.
This commit is contained in:
Richard van der Hoff
2016-07-28 14:30:33 +01:00
parent 59d7935934
commit 188802c5d3
3 changed files with 9 additions and 5 deletions

View File

@@ -560,8 +560,8 @@ MatrixClient.prototype.listDeviceKeys = function(userId) {
result.push({ result.push({
id: deviceId, id: deviceId,
key: ed25519Key, key: ed25519Key,
verified: device.verified == DeviceVerification.VERIFIED, verified: Boolean(device.verified == DeviceVerification.VERIFIED),
blocked: device.verified == DeviceVerification.BLOCKED, blocked: Boolean(device.verified == DeviceVerification.BLOCKED),
}); });
} }
} }

View File

@@ -169,14 +169,18 @@ function aliDownloadsKeys() {
id: "bvcxz", id: "bvcxz",
key: bobDeviceEd25519Key, key: bobDeviceEd25519Key,
verified: false, verified: false,
blocked: false,
}]); }]);
}); });
var p2 = aliQueryKeys(); var p2 = aliQueryKeys();
// check that the localStorage is updated as we expect (not sure this is
// an integration test, but meh)
return q.all([p1, p2]).then(function() { return q.all([p1, p2]).then(function() {
var devices = aliStorage.getEndToEndDevicesForUser(bobUserId); var devices = aliStorage.getEndToEndDevicesForUser(bobUserId);
expect(devices[bobDeviceId].keys).toEqual(bobDeviceKeys.keys); expect(devices[bobDeviceId].keys).toEqual(bobDeviceKeys.keys);
expect(devices[bobDeviceId].verified).toBe(false); expect(devices[bobDeviceId].verified).
toBe(0); // DeviceVerification.UNVERIFIED
}); });
} }

View File

@@ -199,14 +199,14 @@ describe("MatrixClient", function() {
expect(res).toEqual({ expect(res).toEqual({
boris: { boris: {
dev1: { dev1: {
verified: false, verified: 0, // DeviceVerification.UNVERIFIED
keys: { "ed25519:dev1": "k1" }, keys: { "ed25519:dev1": "k1" },
algorithms: ["1"], algorithms: ["1"],
}, },
}, },
chaz: { chaz: {
dev2: { dev2: {
verified: false, verified: 0, // DeviceVerification.UNVERIFIED
keys: { "ed25519:dev2" : "k2" }, keys: { "ed25519:dev2" : "k2" },
algorithms: ["2"], algorithms: ["2"],
}, },