File tree Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ class QueryClient {
74
74
}
75
75
76
76
Future <void > disconnect () async {
77
- await api.disconnect ();
77
+ if (provider! .isConnected ()) {
78
+ await api.disconnect ();
79
+ }
78
80
}
79
81
}
80
82
Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ void main() {
42
42
expect (queryClient.api, isNotNull);
43
43
});
44
44
45
- // TODO: How to test disconnect ??
45
+ test ('Disconnect' , () async {
46
+ await queryClient.disconnect ();
47
+ expect (false , queryClient.provider! .isConnected ());
48
+ });
46
49
});
47
50
48
51
group ("Full Client Tests" , () {
@@ -78,5 +81,10 @@ void main() {
78
81
expect (client.provider, isA <WsProvider >());
79
82
expect (client.api, isNotNull);
80
83
});
84
+
85
+ test ('Disconnect' , () async {
86
+ await client.disconnect ();
87
+ expect (false , client.provider! .isConnected ());
88
+ });
81
89
});
82
90
}
Original file line number Diff line number Diff line change @@ -134,16 +134,16 @@ void main() {
134
134
});
135
135
136
136
// TODO:
137
- // test('Test Create Name Contract then cancel it', () async {
138
- // BigInt? contractId = await client.contracts.createName(name: "xxx");
139
- // expect(contractId, isNotNull);
140
- // await Future.delayed(Duration(seconds: 5));
141
- // try {
142
- // await client.contracts.cancel(contractId: contractId!);
143
- // } catch (error) {
144
- // expect(error, isNull);
145
- // }
146
- // });
137
+ test ('Test Create Name Contract then cancel it' , () async {
138
+ BigInt ? contractId = await client.contracts.createName (name: "xxx" );
139
+ expect (contractId, isNotNull);
140
+ await Future .delayed (Duration (seconds: 5 ));
141
+ try {
142
+ await client.contracts.cancel (contractId: contractId! );
143
+ } catch (error) {
144
+ expect (error, isNull);
145
+ }
146
+ });
147
147
148
148
test ('Test Create Rent Contract with no solution provider' , () async {
149
149
try {
You can’t perform that action at this time.
0 commit comments