Skip to content

Commit

Permalink
RUMM-1454 use the key as view.url
Browse files Browse the repository at this point in the history
  • Loading branch information
xgouchet committed Jul 6, 2021
1 parent c6215de commit b9a9d59
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Sources/Datadog/RUMMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public class RUMMonitor: DDRUMMonitor, RUMCommandSubscriber {
time: dateProvider.currentDate(),
identity: key,
name: name ?? key,
path: name ?? key,
path: key,
attributes: attributes
)
)
Expand Down
8 changes: 4 additions & 4 deletions Tests/DatadogTests/Datadog/RUMMonitorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ class RUMMonitorTests: XCTestCase {
let monitor = RUMMonitor.initialize()
setGlobalAttributes(of: monitor)

monitor.startView(key: "view1", name: "View1")
monitor.startView(key: "view1-key", name: "View1")
monitor.stopView(key: "view1")
monitor.startView(key: "view2", name: "View2")
monitor.startView(key: "view2-key", name: "View2")

let rumEventMatchers = try RUMFeature.waitAndReturnRUMEventMatchers(count: 4)
verifyGlobalAttributes(in: rumEventMatchers)

let session = try XCTUnwrap(try RUMSessionMatcher.groupMatchersBySessions(rumEventMatchers).first)
XCTAssertEqual(session.viewVisits.count, 2)
XCTAssertEqual(session.viewVisits[0].name, "View1")
XCTAssertEqual(session.viewVisits[0].path, "View1")
XCTAssertEqual(session.viewVisits[0].path, "view1-key")
XCTAssertEqual(session.viewVisits[1].name, "View2")
XCTAssertEqual(session.viewVisits[1].path, "View2")
XCTAssertEqual(session.viewVisits[1].path, "view2-key")
}

func testStartingView_thenLoadingImageResourceWithRequest() throws {
Expand Down
4 changes: 2 additions & 2 deletions Tests/DatadogTests/DatadogObjc/DDRUMMonitorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ class DDRUMMonitorTests: XCTestCase {
XCTAssertEqual(event2.view.name, "FirstView")
XCTAssertEqual(event2.view.url, "FirstViewController")
XCTAssertEqual(event3.view.name, "SecondView")
XCTAssertEqual(event3.view.url, "SecondView")
XCTAssertEqual(event3.view.url, "view2")
XCTAssertEqual(event4.view.name, "SecondView")
XCTAssertEqual(event4.view.url, "SecondView")
XCTAssertEqual(event4.view.url, "view2")
XCTAssertEqual(try viewEvents[1].attribute(forKeyPath: "context.event-attribute1"), "foo1")
XCTAssertEqual(try viewEvents[1].attribute(forKeyPath: "context.event-attribute2"), "foo2")
XCTAssertEqual(try viewEvents[3].attribute(forKeyPath: "context.event-attribute1"), "bar1")
Expand Down

0 comments on commit b9a9d59

Please sign in to comment.