@@ -511,7 +511,7 @@ - (void)testFDLComponentsCustomDomainWithPath {
511
511
XCTAssertEqualObjects (actualURL, expectedURL);
512
512
}
513
513
514
- - (void )testFDLComponentsFailsOnMalformedDomain {
514
+ - (void )testFDLComponentsFailsOnMalformedDomainURIPrefix {
515
515
NSString *linkString = @" https://google.com" ;
516
516
NSURL *link = [NSURL URLWithString: linkString];
517
517
@@ -522,6 +522,38 @@ - (void)testFDLComponentsFailsOnMalformedDomain {
522
522
XCTAssertNil (components.url );
523
523
}
524
524
525
+ - (void )testFDLComponentsNotNilOnDomainWithHTTPScheme {
526
+ NSString *linkString = @" https://google.com" ;
527
+ NSURL *link = [NSURL URLWithString: linkString];
528
+
529
+ FIRDynamicLinkComponents *components =
530
+ [FIRDynamicLinkComponents componentsWithLink: link domain: @" http://xyz.page.link" ];
531
+
532
+ XCTAssertNotNil (components);
533
+ }
534
+
535
+ - (void )testFDLComponentsNotNilOnDomainWithHTTPSScheme {
536
+ NSString *linkString = @" https://google.com" ;
537
+ NSURL *link = [NSURL URLWithString: linkString];
538
+
539
+ FIRDynamicLinkComponents *components =
540
+ [FIRDynamicLinkComponents componentsWithLink: link domain: @" https://xyz.page.link" ];
541
+
542
+ XCTAssertNotNil (components);
543
+ }
544
+
545
+ - (void )testFDLComponentsFailsOnMalformedDomain {
546
+ NSString *linkString = @" https://google.com" ;
547
+ NSURL *link = [NSURL URLWithString: linkString];
548
+
549
+ FIRDynamicLinkComponents *components =
550
+ [FIRDynamicLinkComponents componentsWithLink: link
551
+ domain: @" this is invalid domain URI Prefix" ];
552
+
553
+ XCTAssertNotNil (components);
554
+ XCTAssertNil (components.url );
555
+ }
556
+
525
557
- (void )testFDLComponentsCreatesFullLinkCorrectly {
526
558
FIRDynamicLinkGoogleAnalyticsParameters *analyticsParams =
527
559
[FIRDynamicLinkGoogleAnalyticsParameters parameters ];
0 commit comments