@@ -92,28 +92,6 @@ describe('algolia browser search', () => {
92
92
} )
93
93
} )
94
94
95
- describe ( 'google analytics' , ( ) => {
96
- it ( 'is set on page load with expected properties' , async ( ) => {
97
- await page . goto ( 'http://localhost:4001/en/actions' )
98
-
99
- // check that GA global object exists and is a function
100
- const gaObjectType = await page . evaluate ( ( ) => typeof window . ga )
101
- expect ( gaObjectType ) . toBe ( 'function' )
102
-
103
- // check that default tracker is set
104
- // https://developers.google.com/analytics/devguides/collection/analyticsjs/ga-object-methods-reference#getByName
105
- const gaDefaultTracker = await page . evaluate ( ( ) => window . ga . getByName ( 't0' ) )
106
- expect ( 'filters' in gaDefaultTracker ) . toBe ( true )
107
- expect ( Object . keys ( gaDefaultTracker ) ) . toHaveLength ( 3 )
108
-
109
- // check that default cookies are set
110
- // https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage#analyticsjs
111
- const cookies = await page . cookies ( )
112
- expect ( cookies . some ( cookie => cookie . name === '_gat' ) ) . toBe ( true )
113
- expect ( cookies . some ( cookie => cookie . name === '_gid' ) ) . toBe ( true )
114
- } )
115
- } )
116
-
117
95
describe ( 'helpfulness' , ( ) => {
118
96
it ( 'sends an event to /events when submitting form' , async ( ) => {
119
97
// Visit a page that displays the prompt
@@ -122,8 +100,8 @@ describe('helpfulness', () => {
122
100
// Track network requests
123
101
await page . setRequestInterception ( true )
124
102
page . on ( 'request' , request => {
125
- // Ignore GET to google analytics
126
- if ( ! / \/ e v e n t s / . test ( request . method ( ) ) ) return request . continue ( )
103
+ // Ignore GET requests
104
+ if ( ! / \/ e v e n t s $ / . test ( request . url ( ) ) ) return request . continue ( )
127
105
expect ( request . method ( ) ) . toMatch ( / P O S T | P U T / )
128
106
request . respond ( {
129
107
contentType : 'application/json' ,
0 commit comments