1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +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({
id: deviceId,
key: ed25519Key,
verified: device.verified == DeviceVerification.VERIFIED,
blocked: device.verified == DeviceVerification.BLOCKED,
verified: Boolean(device.verified == DeviceVerification.VERIFIED),
blocked: Boolean(device.verified == DeviceVerification.BLOCKED),
});
}
}

View File

@@ -169,14 +169,18 @@ function aliDownloadsKeys() {
id: "bvcxz",
key: bobDeviceEd25519Key,
verified: false,
blocked: false,
}]);
});
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() {
var devices = aliStorage.getEndToEndDevicesForUser(bobUserId);
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({
boris: {
dev1: {
verified: false,
verified: 0, // DeviceVerification.UNVERIFIED
keys: { "ed25519:dev1": "k1" },
algorithms: ["1"],
},
},
chaz: {
dev2: {
verified: false,
verified: 0, // DeviceVerification.UNVERIFIED
keys: { "ed25519:dev2" : "k2" },
algorithms: ["2"],
},