From 30385339a3215c6b42734182cd6210e5cd0f509c Mon Sep 17 00:00:00 2001 From: Ildar Nurislamov Date: Tue, 9 Aug 2022 14:21:34 +0300 Subject: [PATCH] Adjust tests --- server/enrichment/default_test.go | 22 ++++++++++++++-------- server/useragent/resolver_test.go | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/server/enrichment/default_test.go b/server/enrichment/default_test.go index c08471ec9..e07d580d5 100644 --- a/server/enrichment/default_test.go +++ b/server/enrichment/default_test.go @@ -68,10 +68,13 @@ func TestDefault(t *testing.T) { "zip": "14101", }, "parsed_ua": map[string]interface{}{ - "os_family": "Mac OS X", - "os_version": "10.15.5", - "ua_family": "Chrome", - "ua_version": "83.0.4103", + "device_brand": "Apple", + "device_family": "Mac", + "device_model": "Mac", + "os_family": "Mac OS X", + "os_version": "10.15.5", + "ua_family": "Chrome", + "ua_version": "83.0.4103", }, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", }, @@ -96,10 +99,13 @@ func TestDefault(t *testing.T) { "zip": "14101", }, "parsed_ua": map[string]interface{}{ - "os_family": "Mac OS X", - "os_version": "10.15.5", - "ua_family": "Chrome", - "ua_version": "83.0.4103", + "device_brand": "Apple", + "device_family": "Mac", + "device_model": "Mac", + "os_family": "Mac OS X", + "os_version": "10.15.5", + "ua_family": "Chrome", + "ua_version": "83.0.4103", }, "source_ip": "10.10.10.10", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", diff --git a/server/useragent/resolver_test.go b/server/useragent/resolver_test.go index 7409daaee..162d36fdd 100644 --- a/server/useragent/resolver_test.go +++ b/server/useragent/resolver_test.go @@ -29,7 +29,7 @@ func TestResolve(t *testing.T) { { "Ok resolved ua from browser", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", - &ResolvedUa{UaFamily: "Chrome", UaVersion: "83.0.4103", OsFamily: "Mac OS X", OsVersion: "10.15.5"}, + &ResolvedUa{UaFamily: "Chrome", UaVersion: "83.0.4103", OsFamily: "Mac OS X", OsVersion: "10.15.5", DeviceFamily: "Mac", DeviceBrand: "Apple", DeviceModel: "Mac"}, }, } uaResolver := NewResolver()