|
1 | 1 | import type { Duration, RelativeTime, ServerDuration, TaskQueue, TimeStamp } from '@datadog/browser-core' |
2 | | -import { createTaskQueue, ExperimentalFeature, noop, RequestType, ResourceType } from '@datadog/browser-core' |
3 | | -import { mockExperimentalFeatures, registerCleanupTask } from '@datadog/browser-core/test' |
| 2 | +import { createTaskQueue, noop, RequestType, ResourceType } from '@datadog/browser-core' |
| 3 | +import { registerCleanupTask } from '@datadog/browser-core/test' |
4 | 4 | import type { RumFetchResourceEventDomainContext, RumXhrResourceEventDomainContext } from '../../domainContext.types' |
5 | 5 | import { |
6 | 6 | collectAndValidateRawRumEvents, |
@@ -152,9 +152,6 @@ describe('resourceCollection', () => { |
152 | 152 | }) |
153 | 153 |
|
154 | 154 | describe('GraphQL metadata enrichment', () => { |
155 | | - beforeEach(() => { |
156 | | - mockExperimentalFeatures([ExperimentalFeature.GRAPHQL_TRACKING]) |
157 | | - }) |
158 | 155 | interface TestCase { |
159 | 156 | requestType: RequestType |
160 | 157 | name: string |
@@ -279,34 +276,6 @@ describe('resourceCollection', () => { |
279 | 276 | }) |
280 | 277 | }) |
281 | 278 |
|
282 | | - it('should not track GraphQL when feature flag is disabled', () => { |
283 | | - mockExperimentalFeatures([]) |
284 | | - setupResourceCollection({ |
285 | | - trackResources: true, |
286 | | - allowedGraphQlUrls: [{ match: 'https://api.example.com/graphql', trackPayload: true }], |
287 | | - }) |
288 | | - |
289 | | - const requestBody = JSON.stringify({ |
290 | | - query: 'query GetUser { user { name } }', |
291 | | - }) |
292 | | - |
293 | | - notifyRequest({ |
294 | | - request: { |
295 | | - type: RequestType.FETCH, |
296 | | - url: 'https://api.example.com/graphql', |
297 | | - method: 'POST' as const, |
298 | | - init: { |
299 | | - method: 'POST' as const, |
300 | | - body: requestBody, |
301 | | - }, |
302 | | - input: 'https://api.example.com/graphql', |
303 | | - }, |
304 | | - }) |
305 | | - |
306 | | - const resourceEvent = rawRumEvents[0].rawRumEvent as any |
307 | | - expect(resourceEvent.resource.graphql).toBeUndefined() |
308 | | - }) |
309 | | - |
310 | 279 | describe('with trackEarlyRequests enabled', () => { |
311 | 280 | it('creates a resource from a performance entry without a matching request', () => { |
312 | 281 | setupResourceCollection({ trackResources: true, trackEarlyRequests: true }) |
|
0 commit comments