diff --git a/packages/x-adapter-platform/src/mappers/__tests__/url.spec.ts b/packages/x-adapter-platform/src/mappers/__tests__/url.spec.ts index 6e2895cda0..8bff8346dc 100644 --- a/packages/x-adapter-platform/src/mappers/__tests__/url.spec.ts +++ b/packages/x-adapter-platform/src/mappers/__tests__/url.spec.ts @@ -1,4 +1,8 @@ -import { extractUrlParameters, getDisplayClickTagging, getTaggingInfoFromUrl } from '../url.utils'; +import { + extractUrlParameters, + getDisplayTaggingInfoFromUrl, + getTaggingInfoFromUrl +} from '../url.utils'; describe('url utils methods tests', () => { describe('extractUrlParameters', () => { @@ -45,14 +49,14 @@ describe('url utils methods tests', () => { describe('getDisplayClickTagging', () => { it('should not break when dealing with bad urls', () => { - expect(getDisplayClickTagging('null')).toStrictEqual({ + expect(getDisplayTaggingInfoFromUrl('null')).toStrictEqual({ url: 'null', params: { displayId: 'no_query', follow: false } }); }); it('should retrieve the tagging info from the url, replacing q with displayId', () => { - const { url, params } = getDisplayClickTagging( + const { url, params } = getDisplayTaggingInfoFromUrl( 'https://api.empathy.co/?q=chips&env=mobile&lang=english&lang=spanish' ); expect(url).toBe('https://api.empathy.co/'); @@ -65,7 +69,7 @@ describe('url utils methods tests', () => { }); it('should set no_query tagging info when no q param exist as in topclicked response', () => { - const { url, params } = getDisplayClickTagging( + const { url, params } = getDisplayTaggingInfoFromUrl( 'https://api.empathy.co/?env=mobile&lang=english&lang=spanish' ); expect(url).toBe('https://api.empathy.co/'); diff --git a/packages/x-adapter-platform/src/mappers/url.utils.ts b/packages/x-adapter-platform/src/mappers/url.utils.ts index 9f2aa88fef..ad9607ba3b 100644 --- a/packages/x-adapter-platform/src/mappers/url.utils.ts +++ b/packages/x-adapter-platform/src/mappers/url.utils.ts @@ -28,7 +28,7 @@ export function getTaggingInfoFromUrl(taggingUrl: string): TaggingRequest { * * @public */ -export function getDisplayClickTagging(displayTaggingUrl: string): TaggingRequest { +export function getDisplayTaggingInfoFromUrl(displayTaggingUrl: string): TaggingRequest { const displayClickTagging = getTaggingInfoFromUrl(displayTaggingUrl); const displayClickTaggingParams = displayClickTagging.params; diff --git a/packages/x-adapter-platform/src/schemas/models/result.schema.ts b/packages/x-adapter-platform/src/schemas/models/result.schema.ts index 365a61574d..8bdcb6e97d 100644 --- a/packages/x-adapter-platform/src/schemas/models/result.schema.ts +++ b/packages/x-adapter-platform/src/schemas/models/result.schema.ts @@ -1,6 +1,6 @@ import { createMutableSchema } from '@empathyco/x-adapter'; import { Result } from '@empathyco/x-types'; -import { getDisplayClickTagging, getTaggingInfoFromUrl } from '../../mappers/url.utils'; +import { getDisplayTaggingInfoFromUrl, getTaggingInfoFromUrl } from '../../mappers/url.utils'; import { PlatformResult } from '../../types/models/result.model'; /** @@ -36,7 +36,7 @@ export const resultSchema = createMutableSchema({ add2cart: ({ add2cart }) => getTaggingInfoFromUrl(add2cart), checkout: ({ checkout }) => getTaggingInfoFromUrl(checkout), click: ({ click }) => getTaggingInfoFromUrl(click), - displayClick: ({ displayClick }) => getDisplayClickTagging(displayClick) + displayClick: ({ displayClick }) => getDisplayTaggingInfoFromUrl(displayClick) } } }); diff --git a/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts b/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts index 81083dd90d..eee6ceb8e4 100644 --- a/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts +++ b/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts @@ -1,6 +1,6 @@ import { createMutableSchema } from '@empathyco/x-adapter'; import { SearchResponse } from '@empathyco/x-types'; -import { getTaggingInfoFromUrl } from '../../mappers/url.utils'; +import { getDisplayTaggingInfoFromUrl, getTaggingInfoFromUrl } from '../../mappers/url.utils'; import { PlatformSearchResponse } from '../../types/responses/search-response.model'; import { bannerSchema } from '../models/banner.schema'; import { facetSchema } from '../models/facet.schema'; @@ -42,5 +42,5 @@ export const searchResponseSchema = createMutableSchema getTaggingInfoFromUrl(catalog?.tagging?.query), - displayTagging: ({ catalog }) => getTaggingInfoFromUrl(catalog?.tagging?.display) + displayTagging: ({ catalog }) => getDisplayTaggingInfoFromUrl(catalog?.tagging?.display) });