diff --git a/DuckDuckGo/TabSwitcherOpenDailyPixel.swift b/DuckDuckGo/TabSwitcherOpenDailyPixel.swift index 80b2e3fb44..98bb816864 100644 --- a/DuckDuckGo/TabSwitcherOpenDailyPixel.swift +++ b/DuckDuckGo/TabSwitcherOpenDailyPixel.swift @@ -64,7 +64,7 @@ struct TabSwitcherOpenDailyPixel { } private enum ParameterName { - static let tabCount = "TabCount" - static let newTabCount = "NewTabCount" + static let tabCount = "tab_count" + static let newTabCount = "new_tab_count" } } diff --git a/DuckDuckGoTests/TabSwitcherDailyPixelTests.swift b/DuckDuckGoTests/TabSwitcherDailyPixelTests.swift index 49897e216f..2c3c5bf8f2 100644 --- a/DuckDuckGoTests/TabSwitcherDailyPixelTests.swift +++ b/DuckDuckGoTests/TabSwitcherDailyPixelTests.swift @@ -28,8 +28,8 @@ final class TabSwitcherDailyPixelTests: XCTestCase { let parameters = pixel.parameters(with: tabs) - XCTAssertNotNil(parameters["TabCount"]) - XCTAssertNotNil(parameters["NewTabCount"]) + XCTAssertNotNil(parameters[ParameterName.tabCount]) + XCTAssertNotNil(parameters[ParameterName.newTabCount]) } func testIncludesProperCountsForParameters() { @@ -38,8 +38,8 @@ final class TabSwitcherDailyPixelTests: XCTestCase { let parameters = pixel.parameters(with: tabs) - XCTAssertEqual(parameters["TabCount"], "2-5") - XCTAssertEqual(parameters["NewTabCount"], "1-5") + XCTAssertEqual(parameters[ParameterName.tabCount], "2-5") + XCTAssertEqual(parameters[ParameterName.newTabCount], "1-5") } func testBucketsAggregation() { @@ -62,7 +62,7 @@ final class TabSwitcherDailyPixelTests: XCTestCase { for value in bucket.key { let tabs = Array(repeating: Tab.mock(), count: value) - let countParameter = TabSwitcherOpenDailyPixel().parameters(with: tabs)["TabCount"] + let countParameter = TabSwitcherOpenDailyPixel().parameters(with: tabs)[ParameterName.tabCount] XCTAssertEqual(countParameter, bucket.value) } @@ -81,7 +81,7 @@ final class TabSwitcherDailyPixelTests: XCTestCase { for value in bucket.key { let tabs = Array(repeating: Tab(), count: value) - let countParameter = TabSwitcherOpenDailyPixel().parameters(with: tabs)["NewTabCount"] + let countParameter = TabSwitcherOpenDailyPixel().parameters(with: tabs)[ParameterName.newTabCount] XCTAssertEqual(countParameter, bucket.value) } @@ -94,3 +94,8 @@ private extension Tab { Tab(link: Link(title: nil, url: URL("https://example.com")!)) } } + +private enum ParameterName { + static let newTabCount = "new_tab_count" + static let tabCount = "tab_count" +}