@@ -191,6 +191,38 @@ void main() {
191191 throwsA (isA <PlatformException >()));
192192 });
193193
194+ test ('send e-mail' , () async {
195+ await launch ('mailto:gmail-noreply@google.com?subject=Hello' );
196+ expect (
197+ verify (await mock.launch (
198+ any,
199+ useSafariVC: anyNamed ('useSafariVC' ),
200+ useWebView: anyNamed ('useWebView' ),
201+ enableJavaScript: anyNamed ('enableJavaScript' ),
202+ enableDomStorage: anyNamed ('enableDomStorage' ),
203+ universalLinksOnly: anyNamed ('universalLinksOnly' ),
204+ headers: anyNamed ('headers' ),
205+ )),
206+ isInstanceOf <VerificationResult >(),
207+ );
208+ });
209+
210+ test ('cannot send e-mail with forceSafariVC: true' , () async {
211+ expect (
212+ () async => await launch (
213+ 'mailto:gmail-noreply@google.com?subject=Hello' ,
214+ forceSafariVC: true ),
215+ throwsA (isA <PlatformException >()));
216+ });
217+
218+ test ('cannot send e-mail with forceWebView: true' , () async {
219+ expect (
220+ () async => await launch (
221+ 'mailto:gmail-noreply@google.com?subject=Hello' ,
222+ forceWebView: true ),
223+ throwsA (isA <PlatformException >()));
224+ });
225+
194226 test ('controls system UI when changing statusBarBrightness' , () async {
195227 final TestWidgetsFlutterBinding binding =
196228 TestWidgetsFlutterBinding .ensureInitialized ();
0 commit comments