mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
add to killswitch disabled test
This commit is contained in:
parent
dea3be904e
commit
4aba0b50fb
1 changed files with 6 additions and 3 deletions
|
@ -1561,6 +1561,7 @@ void main() {
|
||||||
verifyNoMoreInteractions(mockPrefs);
|
verifyNoMoreInteractions(mockPrefs);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// useTor is true but Tor is not enabled, but because the killswitch is off, TorService calls should be made.
|
||||||
test("killswitch disabled", () async {
|
test("killswitch disabled", () async {
|
||||||
final mockClient = MockJsonRPC();
|
final mockClient = MockJsonRPC();
|
||||||
const command = "blockchain.transaction.get";
|
const command = "blockchain.transaction.get";
|
||||||
|
@ -1583,8 +1584,8 @@ void main() {
|
||||||
when(mockPrefs.useTor).thenAnswer((_) => true);
|
when(mockPrefs.useTor).thenAnswer((_) => true);
|
||||||
when(mockPrefs.torKillswitch).thenAnswer((_) => false);
|
when(mockPrefs.torKillswitch).thenAnswer((_) => false);
|
||||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||||
final torService = MockTorService();
|
final mockTorService = MockTorService();
|
||||||
when(torService.enabled).thenAnswer((_) => false);
|
when(mockTorService.enabled).thenAnswer((_) => false);
|
||||||
|
|
||||||
final client = ElectrumX(
|
final client = ElectrumX(
|
||||||
host: "some server",
|
host: "some server",
|
||||||
|
@ -1593,7 +1594,7 @@ void main() {
|
||||||
client: mockClient,
|
client: mockClient,
|
||||||
failovers: [],
|
failovers: [],
|
||||||
prefs: mockPrefs,
|
prefs: mockPrefs,
|
||||||
torService: torService,
|
torService: mockTorService,
|
||||||
);
|
);
|
||||||
|
|
||||||
final result = await client.getTransaction(
|
final result = await client.getTransaction(
|
||||||
|
@ -1607,6 +1608,8 @@ void main() {
|
||||||
verify(mockPrefs.useTor).called(1);
|
verify(mockPrefs.useTor).called(1);
|
||||||
verify(mockPrefs.torKillswitch).called(1);
|
verify(mockPrefs.torKillswitch).called(1);
|
||||||
verifyNoMoreInteractions(mockPrefs);
|
verifyNoMoreInteractions(mockPrefs);
|
||||||
|
verify(mockTorService.enabled).called(1);
|
||||||
|
verifyNoMoreInteractions(mockTorService);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue