Skip to content

Commit

Permalink
test: Fix testSkipCrumbs_WhenSenderOrTargetIsNil (#4253)
Browse files Browse the repository at this point in the history
The testSkipCrumbs_WhenSenderOrTargetIsNil failed, because a
connectivity crumb popped up during the test. This is fixed now by
only validating that the crumbs don't contain any touch crumbs.
  • Loading branch information
philipphofmann authored Aug 7, 2024
1 parent 676fe22 commit 5d6bf0e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ class SentryBreadcrumbTrackerTests: XCTestCase {
swizzlingWrapper.execute(action: "methodPressed:", target: nil, sender: self, event: nil)
swizzlingWrapper.execute(action: "methodPressed:", target: self, sender: nil, event: nil)

// The tracker adds 1 enabled crumb when being started
XCTAssertEqual(1, delegate.addCrumbInvocations.invocations.count)
let touchCrumbs = delegate.addCrumbInvocations.invocations.filter { crumb in
return crumb.category == "touch"
}
XCTAssertEqual(0, touchCrumbs.count)
}

func testTouchBreadcrumbForSessionReplay() throws {
Expand Down

0 comments on commit 5d6bf0e

Please sign in to comment.