Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Improve expectation in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom committed Jun 15, 2022
1 parent eaab52e commit c06313d
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,7 @@ void main() {
});

webViewClient.urlLoading(MockWebView(), 'https://flutter.dev');
await completer.future;
expect(completer.isCompleted, isTrue);
expect(completer.future, completes);
});

test(
Expand Down Expand Up @@ -983,12 +982,11 @@ void main() {
});

webViewClient.requestLoading(MockWebView(), mockRequest);
await completer.future;
expect(completer.isCompleted, isTrue);
expect(completer.future, completes);
});

test(
'requestLoading should not call onLoadUrlCallback when onNavigationRequestCallback returns false',
'requestLoading should not call loadUrl when onNavigationRequestCallback returns false',
() {
final MockWebResourceRequest mockRequest = MockWebResourceRequest();
when(mockRequest.isForMainFrame).thenReturn(true);
Expand All @@ -1012,7 +1010,7 @@ void main() {
});

test(
'requestLoading should not call onLoadUrlCallback when onNavigationRequestCallback returns a Future false',
'requestLoading should not call loadUrl when onNavigationRequestCallback returns a Future false',
() {
final MockWebResourceRequest mockRequest = MockWebResourceRequest();
when(mockRequest.isForMainFrame).thenReturn(true);
Expand Down

0 comments on commit c06313d

Please sign in to comment.