Skip to content

Fix testUniversalLinkDoesNotRelayToSystemWhenUnhandled to actually test that openURL should NOT have been called #192143

Open

Description

@jmagman

Nit raised in https://github.com/flutter/flutter/pull/185430/changes#r3732182641 was not addressed.

testUniversalLinkDoesNotRelayToSystemWhenUnhandled isn't currently testing anything because the invocation is before the OCMReject.

BOOL result = [self.appDelegate
application:[UIApplication sharedApplication]
continueUserActivity:userActivity
restorationHandler:^(NSArray<id<UIUserActivityRestoring>>* __nullable restorableObjects){
}];
XCTAssertTrue(result);
// openURL should NOT have been called.
OCMReject([mockApplication openURL:[OCMArg any]
options:[OCMArg any]
completionHandler:[OCMArg any]]);

OCMReject (or -reject) is an "expect" not "verify" in the "expect-run-verify" pattern, it needs to be called before the code that's being tested.

Activity

  1. added
    a: tests
    platform-ios
    team-ios
    on Sep 2, 2026
  2. added
    P2
    triaged-ios
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2a: testsplatform-iosteam-iostriaged-ios

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions