mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 19:39:22 +00:00
add to killswitch enabled test
This commit is contained in:
parent
4aba0b50fb
commit
941a24a6cc
1 changed files with 6 additions and 3 deletions
|
@ -1506,6 +1506,7 @@ void main() {
|
|||
});
|
||||
|
||||
group("Tor killswitch tests", () {
|
||||
// useTor is true, but TorService is not enabled and the killswitch is on, so no TorService calls should be made.
|
||||
test("killswitch enabled", () async {
|
||||
final mockClient = MockJsonRPC();
|
||||
const command = "blockchain.transaction.get";
|
||||
|
@ -1531,8 +1532,8 @@ void main() {
|
|||
when(mockPrefs.useTor).thenAnswer((_) => true);
|
||||
when(mockPrefs.torKillswitch).thenAnswer((_) => true);
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final torService = MockTorService();
|
||||
when(torService.enabled).thenAnswer((_) => false);
|
||||
final mockTorService = MockTorService();
|
||||
when(mockTorService.enabled).thenAnswer((_) => false);
|
||||
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1541,7 +1542,7 @@ void main() {
|
|||
client: mockClient,
|
||||
failovers: [],
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
torService: mockTorService,
|
||||
);
|
||||
|
||||
try {
|
||||
|
@ -1559,6 +1560,8 @@ void main() {
|
|||
verify(mockPrefs.useTor).called(1);
|
||||
verify(mockPrefs.torKillswitch).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
verify(mockTorService.enabled).called(1);
|
||||
verifyNoMoreInteractions(mockTorService);
|
||||
});
|
||||
|
||||
// useTor is true but Tor is not enabled, but because the killswitch is off, TorService calls should be made.
|
||||
|
|
Loading…
Reference in a new issue