feat: Implement enabling and disabling devices
This commit is contained in:
@@ -12,6 +12,7 @@ void main() {
|
||||
// Caroline starts a chat a device from Alice
|
||||
await btbv.onNewSession(aliceJid, 1);
|
||||
expect(await btbv.isTrusted(aliceJid, 1), true);
|
||||
expect(await btbv.isEnabled(aliceJid, 1), true);
|
||||
|
||||
// Caroline meets with Alice and verifies her fingerprint
|
||||
await btbv.setDeviceTrust(aliceJid, 1, BTBVTrustState.verified);
|
||||
@@ -21,6 +22,7 @@ void main() {
|
||||
await btbv.onNewSession(aliceJid, 2);
|
||||
expect(await btbv.isTrusted(aliceJid, 2), false);
|
||||
expect(btbv.getDeviceTrust(aliceJid, 2), BTBVTrustState.notTrusted);
|
||||
expect(await btbv.isEnabled(aliceJid, 2), false);
|
||||
|
||||
// Caronline starts a chat with Bob but since they live far apart, Caroline cannot
|
||||
// verify his fingerprint.
|
||||
@@ -32,5 +34,7 @@ void main() {
|
||||
expect(await btbv.isTrusted(bobJid, 4), true);
|
||||
expect(btbv.getDeviceTrust(bobJid, 3), BTBVTrustState.blindTrust);
|
||||
expect(btbv.getDeviceTrust(bobJid, 4), BTBVTrustState.blindTrust);
|
||||
expect(await btbv.isEnabled(bobJid, 3), true);
|
||||
expect(await btbv.isEnabled(bobJid, 4), true);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user