From aeff35bee2158d9453e437d307eff28ff2861bc9 Mon Sep 17 00:00:00 2001 From: louiszawadzki Date: Wed, 10 Jan 2024 17:34:50 +0100 Subject: [PATCH] Fix tests after update --- packages/core/ios/Tests/AnyEncodableTests.swift | 2 +- packages/core/ios/Tests/MockRUMMonitor.swift | 4 ++++ packages/core/ios/Tests/RUMMocks.swift | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/core/ios/Tests/AnyEncodableTests.swift b/packages/core/ios/Tests/AnyEncodableTests.swift index d786b35e3..90a83826c 100644 --- a/packages/core/ios/Tests/AnyEncodableTests.swift +++ b/packages/core/ios/Tests/AnyEncodableTests.swift @@ -103,7 +103,7 @@ internal class AnyEncodableTests: XCTestCase { ], "boolean" : true, "date" : "1970-01-01T00:00:00Z", - "double" : 3.1415926535897931, + "double" : 3.141592653589793, "integer" : 42, "nested" : { "a" : "alpha", diff --git a/packages/core/ios/Tests/MockRUMMonitor.swift b/packages/core/ios/Tests/MockRUMMonitor.swift index df8b27ac1..c77d6c071 100644 --- a/packages/core/ios/Tests/MockRUMMonitor.swift +++ b/packages/core/ios/Tests/MockRUMMonitor.swift @@ -10,6 +10,10 @@ @testable import DatadogSDKReactNative internal class MockRUMMonitor: RUMMonitorProtocol { + func currentSessionID(completion: @escaping (String?) -> Void) { + // not implemented + } + init () { self.debug = false } diff --git a/packages/core/ios/Tests/RUMMocks.swift b/packages/core/ios/Tests/RUMMocks.swift index b43dbe3f3..3e9324f68 100644 --- a/packages/core/ios/Tests/RUMMocks.swift +++ b/packages/core/ios/Tests/RUMMocks.swift @@ -260,15 +260,17 @@ extension RUMResourceEvent: RandomMockable { configuration: nil, discarded: nil, rulePsr: nil, - session: .init(plan: .plan1), + session: .init(plan: .plan1, sessionPrecondition: nil), spanId: .mockRandom(), traceId: .mockRandom() ), action: .init(id: .mockRandom()), application: .init(id: .mockRandom()), + buildId: nil, buildVersion: nil, ciTest: nil, connectivity: .mockRandom(), + container: nil, context: .init(contextInfo: ["_dd.resource.drop_resource": true] ), date: .mockRandom(), device: .mockRandom(), @@ -319,15 +321,17 @@ extension RUMResourceEvent: RandomMockable { configuration: nil, discarded: nil, rulePsr: nil, - session: .init(plan: .plan1), + session: .init(plan: .plan1, sessionPrecondition: nil), spanId: .mockRandom(), traceId: .mockRandom() ), action: .init(id: .mockRandom()), application: .init(id: .mockRandom()), + buildId: nil, buildVersion: nil, ciTest: nil, connectivity: .mockRandom(), + container: nil, context: .mockRandom(), date: .mockRandom(), device: .mockRandom(), @@ -386,7 +390,7 @@ extension RUMActionEvent: RandomMockable { ), browserSdkVersion: nil, configuration: nil, - session: .init(plan: .plan1) + session: .init(plan: .plan1, sessionPrecondition: nil) ), action: .init( crash: .init(count: .mockRandom()), @@ -400,9 +404,11 @@ extension RUMActionEvent: RandomMockable { type: [.tap, .swipe, .scroll].randomElement()! ), application: .init(id: .mockRandom()), + buildId: nil, buildVersion: nil, ciTest: nil, connectivity: .mockRandom(), + container: nil, context: .init(contextInfo: ["_dd.resource.drop_resource": true] ), date: .mockRandom(), device: .mockRandom(), @@ -440,7 +446,7 @@ extension RUMActionEvent: RandomMockable { ), browserSdkVersion: nil, configuration: nil, - session: .init(plan: .plan1) + session: .init(plan: .plan1, sessionPrecondition: nil) ), action: .init( crash: .init(count: .mockRandom()), @@ -454,9 +460,11 @@ extension RUMActionEvent: RandomMockable { type: [.tap, .swipe, .scroll].randomElement()! ), application: .init(id: .mockRandom()), + buildId: nil, buildVersion: nil, ciTest: nil, connectivity: .mockRandom(), + container: nil, context: .mockRandom(), date: .mockRandom(), device: .mockRandom(),