-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1471 from DataDog/release/2.2.1
Release 2.2.1
- Loading branch information
Showing
21 changed files
with
202 additions
and
16 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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// GENERATED FILE: Do not edit directly | ||
|
||
internal let __sdkVersion = "2.2.0" | ||
internal let __sdkVersion = "2.2.1" |
69 changes: 69 additions & 0 deletions
69
DatadogCore/Tests/DatadogObjc/DDUIKitRUMActionsPredicateTests.swift
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,69 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-Present Datadog, Inc. | ||
*/ | ||
|
||
import XCTest | ||
import DatadogObjc | ||
import DatadogRUM | ||
|
||
#if canImport(SwiftUI) | ||
import SwiftUI | ||
#endif | ||
|
||
class DDUIKitRUMActionsPredicateTests: XCTestCase { | ||
func testGivenDefaultPredicate_whenAskingForCustomView_itNamesTheActionByItsClassName() { | ||
// Given | ||
let predicate = DDDefaultUIKitRUMActionsPredicate() | ||
|
||
// When | ||
#if os(tvOS) | ||
let rumAction = predicate.rumAction(press: .select, targetView: UIButton()) | ||
#else | ||
let rumAction = predicate.rumAction(targetView: UIButton()) | ||
#endif | ||
// Then | ||
XCTAssertEqual(rumAction?.name, "UIButton") | ||
XCTAssertTrue(rumAction!.attributes.isEmpty) | ||
} | ||
|
||
func testGivenDefaultPredicate_whenAskingForViewWithAccesiblityIdentifier_itNamesTheActionWithIt() { | ||
// Given | ||
let predicate = DDDefaultUIKitRUMActionsPredicate() | ||
let targetView = UIButton() | ||
targetView.accessibilityIdentifier = "Identifier" | ||
|
||
// When | ||
#if os(tvOS) | ||
let rumAction = predicate.rumAction(press: .select, targetView: targetView) | ||
#else | ||
let rumAction = predicate.rumAction(targetView: targetView) | ||
#endif | ||
|
||
// Then | ||
XCTAssertEqual(rumAction?.name, "UIButton(Identifier)") | ||
XCTAssertTrue(rumAction!.attributes.isEmpty) | ||
} | ||
|
||
#if canImport(SwiftUI) | ||
func testGivenDefaultPredicate_whenAskingSwiftUIView_itReturnsAction() { | ||
guard #available(iOS 13, tvOS 13, *) else { | ||
return | ||
} | ||
// Given | ||
let predicate = DDDefaultUIKitRUMActionsPredicate() | ||
|
||
// When | ||
let swiftUIView = UIHostingController(rootView: EmptyView()).view! | ||
#if os(tvOS) | ||
let rumAction = predicate.rumAction(press: .select, targetView: swiftUIView) | ||
#else | ||
let rumAction = predicate.rumAction(targetView: swiftUIView) | ||
#endif | ||
|
||
// Then | ||
XCTAssertNotNil(rumAction) | ||
} | ||
#endif | ||
} |
71 changes: 71 additions & 0 deletions
71
DatadogCore/Tests/DatadogObjc/DDUIKitRUMViewsPredicateTests.swift
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,71 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-Present Datadog, Inc. | ||
*/ | ||
|
||
import XCTest | ||
import DatadogObjc | ||
|
||
@testable import DatadogRUM | ||
|
||
#if canImport(SwiftUI) | ||
import SwiftUI | ||
#endif | ||
|
||
class DDUIKitRUMViewsPredicateTests: XCTestCase { | ||
func testGivenDefaultPredicate_whenAskingForCustomSwiftViewController_itNamesTheViewByItsClassName() { | ||
// Given | ||
let predicate = DDDefaultUIKitRUMViewsPredicate() | ||
|
||
// When | ||
let customViewController = createMockView(viewControllerClassName: "CustomSwiftViewController") | ||
let rumView = predicate.rumView(for: customViewController) | ||
|
||
// Then | ||
XCTAssertEqual(rumView?.name, "CustomSwiftViewController") | ||
XCTAssertTrue(rumView!.attributes.isEmpty) | ||
} | ||
|
||
func testGivenDefaultPredicate_whenAskingForCustomObjcViewController_itNamesTheViewByItsClassName() { | ||
// Given | ||
let predicate = DDDefaultUIKitRUMViewsPredicate() | ||
|
||
// When | ||
let customViewController = CustomObjcViewController() | ||
let rumView = predicate.rumView(for: customViewController) | ||
|
||
// Then | ||
XCTAssertEqual(rumView?.name, "CustomObjcViewController") | ||
XCTAssertTrue(rumView!.attributes.isEmpty) | ||
} | ||
|
||
func testGivenDefaultPredicate_whenAskingUIKitViewController_itReturnsNoView() { | ||
// Given | ||
let predicate = DDDefaultUIKitRUMViewsPredicate() | ||
|
||
// When | ||
let uiKitViewController = UIViewController() | ||
let rumView = predicate.rumView(for: uiKitViewController) | ||
|
||
// Then | ||
XCTAssertNil(rumView) | ||
} | ||
|
||
#if canImport(SwiftUI) | ||
func testGivenDefaultPredicate_whenAskingSwiftUIViewController_itReturnsNoView() { | ||
guard #available(iOS 13, tvOS 13, *) else { | ||
return | ||
} | ||
// Given | ||
let predicate = DDDefaultUIKitRUMViewsPredicate() | ||
|
||
// When | ||
let swiftUIHostingController = UIHostingController<EmptyView>(rootView: EmptyView()) | ||
let rumView = predicate.rumView(for: swiftUIHostingController) | ||
|
||
// Then | ||
XCTAssertNil(rumView) | ||
} | ||
#endif | ||
} |
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
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
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
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
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