Skip to content

Commit

Permalink
fix(recommendationcontroller): send core result data and not active d…
Browse files Browse the repository at this point in the history
…isplay data in beacon tracking
  • Loading branch information
chrisFrazier77 committed Nov 12, 2024
1 parent 13e39b7 commit 1c1754a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,10 @@ describe('Recommendation Controller', () => {
*/

const result = controller.store.results[0];

//this tests we send the core data and not the display data
result.mask.set({ id: 'custom' });

const productEventReturn = controller.track.product.impression(result);

expect(trackfn).toHaveBeenCalledWith({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class RecommendationController extends AbstractController {
product: {
id: result.id,
mappings: {
core: result.display.mappings.core,
core: result.mappings.core,
},
seed: getSeed(),
},
Expand Down Expand Up @@ -170,7 +170,7 @@ export class RecommendationController extends AbstractController {
product: {
id: result.id,
mappings: {
core: result.display.mappings.core,
core: result.mappings.core,
},
seed: getSeed(),
},
Expand Down Expand Up @@ -198,7 +198,7 @@ export class RecommendationController extends AbstractController {
product: {
id: result.id,
mappings: {
core: result.display.mappings.core,
core: result.mappings.core,
},
seed: getSeed(),
},
Expand Down Expand Up @@ -233,7 +233,7 @@ export class RecommendationController extends AbstractController {
product: {
id: result.id,
mappings: {
core: result.display.mappings.core,
core: result.mappings.core,
},
seed: getSeed(),
},
Expand Down Expand Up @@ -268,7 +268,7 @@ export class RecommendationController extends AbstractController {
product: {
id: result.id,
mappings: {
core: result.display.mappings.core,
core: result.mappings.core,
},
seed: getSeed(),
},
Expand Down Expand Up @@ -297,7 +297,7 @@ export class RecommendationController extends AbstractController {
products: results.map((result) => ({
id: result.id,
mappings: {
core: result.display.mappings.core,
core: result.mappings.core,
},
quantity: result.quantity,
})),
Expand Down

0 comments on commit 1c1754a

Please sign in to comment.