Skip to content

fix(journeys): remove audience pageview call #78

fix(journeys): remove audience pageview call

fix(journeys): remove audience pageview call #78

GitHub Actions / Unit Tests succeeded Sep 21, 2023 in 0s

Unit Tests ✅

Tests passed successfully

✅ test-results.json

112 tests were completed in 56ms with 105 passed, 0 failed and 7 skipped.

Test suite Passed Failed Skipped Time
test/0_config.js 7✅ 0ms
test/1_utils.js 90✅ 7⚪ 34ms
test/6_branch_new.js 1✅ 0ms
test/journeys_utils.js 7✅ 1ms

✅ test/0_config.js

config api_endpoint
  ✅ api_endpoint should be defined
  ✅ api_endpoint value is correct
config app_service_endpoint
  ✅ app_service_endpoint should be defined
  ✅ app_service_endpoint value is correct
config link_service_endpoint
  ✅ link_service_endpoint should be defined
  ✅ link_service_endpoint value is correct
config version
  ✅ version should be defined

✅ test/1_utils.js

utils addPropertyIfNotNullorEmpty
  ✅ should add property if value is not empty
  ✅ should not add property if value is empty
  ✅ should not add property if value is null
utils base64encode
  ✅ should encode a string
utils cleanLinkData
  ✅ should accept empty linkData
  ✅ should not stringify pre-stringified field "data"
  ✅ should stringify field "data" and add "source"
utils convertObjectValuesToString
  ✅ a complex object's values should be stringified
  ✅ a simple object's values should be stringified
  ✅ should return empty object
utils convertValueToString
  ✅ should stringify a boolean
  ✅ should stringify a number
  ✅ should stringify an array
  ✅ should stringify an object
  ✅ should stringify null
utils delay function
  ✅ calls synchronously for a negative delay argument
  ✅ calls synchronously for a non-numeric delay argument
  ✅ calls synchronously for a zero delay argument
  ✅ delays for any positive numeric argument
utils extractDeeplinkPath
  ✅ should return deeplink path for a url with implicit protocol
  ✅ should return deeplink path for an https:// url
  ✅ should return empty string if there is no deeplink path
utils extractMobileDeeplinkPath
  ✅ should return a deeplink path if "/" is prepended
  ✅ should return deeplink path if no protocol is given
  ✅ should return deeplink path mobile scheme url
  ✅ should return empty string if there is no deeplink path
utils getClickIdAndSearchStringFromLink
  ✅ If "" is passed in, "" should be returned"
  ✅ If "http://example.com:3000?test=test" is passed in, ?test=test should be returned"
  ✅ If "http://example.com:3000/?test=test" is passed in, ?test=test should be returned"
  ✅ If "http://example.com:3000/c/clickid?search=test#hash" is passed in, clickid?search=test should be returned"
  ✅ If "http://example.com:3000/c/clickid/?search=test#hash" is passed in, clickid?search=test should be returned"
  ✅ If {} is passed in, "" should be returned"
  ⚪ If /123abc is passed in, 123abc should be returned"
  ⚪ If /c/123abc is passed in, 123abc should be returned"
  ⚪ If /c/123abc?key1=val1 is passed in, 123abc?key1=val1 should be returned"
  ✅ If null is passed in, "" should be returned"
  ✅ If undefined is passed in, "" should be returned"
utils getHostedDeepLinkData
  ✅ $ios_deeplink_path and $android_deeplink_path should be formed from hosted metadata
  ✅ $ios_deeplink_path and $android_deeplink_path should be formed from twitter tags
  ✅ $ios_deeplink_path and $android_deeplink_path should be formed from twitter tags. $deeplink_path should also be present
  ✅ $ios_deeplink_path should be formed from applinks tag and $android_deeplink_path from hosted metadata tag
  ✅ Original key:value pairs in params should be present
  ⚪ should find applink, twitter and branch hosted data on page
  ✅ should return an object
  ⚪ should return OG tags
utils getParamValue
  ✅ should return search param value
  ✅ should return undefined if not set
utils hashValue
  ✅ should return hash param value
  ✅ should return undefined if not set
utils isIOSWKWebView function
  ✅ should return false for Chrome
  ✅ should return false for Edge
  ✅ should return false for Firefox
  ✅ should return false for Opera
  ✅ should return false for Yandex
  ✅ should return false when UA is iOS but window.webkitURL is not defined
  ✅ should return false when UA is not iOS but window.webkitURL is defined
  ✅ should return true when UA includes iPad & window.webkitURL is defined
  ✅ should return true when UA includes iPhone & window.webkitURL is defined
  ✅ should return true when UA includes iPod & window.webkitURL is defined
utils isSafari11OrGreater
  ✅ should return false for non safari browsers
  ✅ should return true for safari 11 browsers
utils isWebKitBrowser function
  ✅ returns false when window.webkitURL is not defined
  ✅ returns true when window.webkitURL is defined
utils merge
  ✅ should handle an non-object for first argument
  ✅ should handle an non-object for second argument
  ✅ should merge two objects despite duplication
utils mergeMetadataFromInitToHostedMetadata
  ✅ ensure that additionalMetadata['hosted_deeplink_data'] does not get mutated
  ✅ ensure that userSuppliedMetadata does not get mutated
  ⚪ merge hosted_deeplink_data and user-supplied metadata
  ⚪ override previous hosted_deeplink_data keys via user-supplied metadata object
  ✅ tests with metadata and without hosted_deeplink_data
utils message
  ✅ should produce a Branch SDK already init message
  ✅ should produce a Branch SDK not init message
  ✅ should produce a call branch init first
  ✅ should produce a missing app id
  ✅ should produce a missing identity error
  ✅ should produce a missing param message
  ✅ should produce a missing URL error
  ✅ should produce a timeout message
  ✅ should produce an invalid param type message
utils removeTrailingDotZeros
  ✅ multi-dot : should return string with trailing dot zeros stripped
  ✅ no dot- should not strip trailing dot zero
  ✅ should not strip trailing dot zero
  ✅ should return empty if value is empty
  ✅ should return null if value is null
  ✅ single dot- should not strip trailing dot zero
  ✅ with dot and no zeros- should not strip trailing dot zero
utils separateEventAndCustomData
  ✅ extracted custom and event data should equal initial objects
  ✅ should return true or false for a given parameter and type
  ✅ utils.isStandardEvent() should return true for standard events and false for custom events
utils Tests for utils.userPreferences.shouldBlockRequest()
  ✅ should allow raw links
  ✅ should return false with v1/open as url endpoint and valid request data provided
  ✅ should return true with v1/bogus as url endpoint
  ✅ should return true with v1/open as url endpoint and no request data provided
  ✅ should return true with v1/xyz as url endpoint and with bogus request data
utils whiteListSessionData
  ✅ should make missing params null
  ✅ should remove unwanted params

✅ test/6_branch_new.js

Branch - new referringLink
  ✅ test method exists

✅ test/journeys_utils.js

getRelativeHeightValueOrFalseFromBannerHeight
  ✅ should return false when bannerHeight is in pixel values
  ✅ should return the height value when bannerHeight is provided with percentage units - 100%
  ✅ should return the height value when bannerHeight is provided with percentage units - 5%
  ✅ should return the height value when bannerHeight is provided with percentage units - 99%
  ✅ should return the height value when bannerHeight is provided with viewHeight units - 100vh
  ✅ should return the height value when bannerHeight is provided with viewHeight units - 5vh
  ✅ should return the height value when bannerHeight is provided with viewHeight units - 99vh