You've already forked matrix-js-sdk
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:
@@ -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),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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"],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user