-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for launching learn more link
Also modifies the existing test for the SubscribeNow page's launcher to unify the launcher mocks.
- Loading branch information
Showing
3 changed files
with
69 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'package:url_launcher_platform_interface/link.dart'; | ||
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; | ||
|
||
class FakeUrlLauncher extends UrlLauncherPlatform { | ||
bool launched = false; | ||
|
||
@override | ||
Future<bool> canLaunch(String url) async { | ||
return true; | ||
} | ||
|
||
@override | ||
Future<void> closeWebView() async {} | ||
|
||
@override | ||
Future<bool> launchUrl(String url, LaunchOptions options) async { | ||
launched = true; | ||
return true; | ||
} | ||
|
||
@override | ||
Future<bool> supportsCloseForMode(PreferredLaunchMode mode) async { | ||
return true; | ||
} | ||
|
||
@override | ||
Future<bool> supportsMode(PreferredLaunchMode mode) async { | ||
return true; | ||
} | ||
|
||
@override | ||
Future<bool> launch( | ||
String url, { | ||
required bool useSafariVC, | ||
required bool useWebView, | ||
required bool enableJavaScript, | ||
required bool enableDomStorage, | ||
required bool universalLinksOnly, | ||
required Map<String, String> headers, | ||
String? webOnlyWindowName, | ||
}) async { | ||
launched = true; | ||
return true; | ||
} | ||
|
||
@override | ||
LinkDelegate? get linkDelegate => null; | ||
} |