fix tests and stuffs
This commit is contained in:
parent
af961b99dc
commit
ead44e4014
|
@ -113,9 +113,7 @@ abstract class _SignedKey {
|
|||
}
|
||||
|
||||
bool hasValidSignatureChain({Set<String> visited}) {
|
||||
if (visited == null) {
|
||||
visited = Set<String>();
|
||||
}
|
||||
visited ??= <String>{};
|
||||
final setKey = '${userId};${identifier}';
|
||||
if (visited.contains(setKey)) {
|
||||
return false; // prevent recursion
|
||||
|
|
|
@ -601,7 +601,7 @@ void main() {
|
|||
'dSO80A01XiigH3uBiDVx/EjzaoycHcjq9lfQX0uWsqxl2giMIiSPR8a4d291W1ihKJL/a+myXS367WT6NAIcBA'
|
||||
}
|
||||
}
|
||||
});
|
||||
}, matrix);
|
||||
test('startOutgoingOlmSessions', () async {
|
||||
expect(matrix.olmSessions.length, 0);
|
||||
if (olmEnabled) {
|
||||
|
|
|
@ -56,21 +56,21 @@ void main() {
|
|||
};
|
||||
|
||||
var userDeviceKeys = <String, DeviceKeysList>{
|
||||
'@alice:example.com': DeviceKeysList.fromJson(rawListJson),
|
||||
'@alice:example.com': DeviceKeysList.fromJson(rawListJson, null),
|
||||
};
|
||||
var userDeviceKeyRaw = <String, dynamic>{
|
||||
'@alice:example.com': rawListJson,
|
||||
};
|
||||
|
||||
expect(json.encode(DeviceKeys.fromJson(rawJson).toJson()),
|
||||
expect(json.encode(DeviceKeys.fromJson(rawJson, null).toJson()),
|
||||
json.encode(rawJson));
|
||||
expect(json.encode(DeviceKeysList.fromJson(rawListJson).toJson()),
|
||||
expect(json.encode(DeviceKeysList.fromJson(rawListJson, null).toJson()),
|
||||
json.encode(rawListJson));
|
||||
|
||||
var mapFromRaw = <String, DeviceKeysList>{};
|
||||
for (final rawListEntry in userDeviceKeyRaw.entries) {
|
||||
mapFromRaw[rawListEntry.key] =
|
||||
DeviceKeysList.fromJson(rawListEntry.value);
|
||||
DeviceKeysList.fromJson(rawListEntry.value, null);
|
||||
}
|
||||
expect(mapFromRaw.toString(), userDeviceKeys.toString());
|
||||
});
|
||||
|
|
|
@ -109,7 +109,7 @@ void test() async {
|
|||
assert(!testClientB
|
||||
.userDeviceKeys[testUserA].deviceKeys[testClientA.deviceID].blocked);
|
||||
await testClientA.userDeviceKeys[testUserB].deviceKeys[testClientB.deviceID]
|
||||
.setVerified(true, testClientA);
|
||||
.setVerified(true);
|
||||
|
||||
print('++++ Check if own olm device is verified by default ++++');
|
||||
assert(testClientA.userDeviceKeys.containsKey(testUserA));
|
||||
|
|
Loading…
Reference in a new issue