@vtex/vtexis-compatibility-layer
Version:
Compatibility layer between intelligent search and VTEX
15 lines (14 loc) • 921 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const mergeProductWithItems_1 = require("../mergeProductWithItems");
const itemsWithSimulationResponse_1 = require("./mock/itemsWithSimulationResponse");
const vtexProduct_1 = require("./mock/vtexProduct");
describe('mergeProductWithItems', () => {
it('should be able to merge the results from the itemsWithSimulation query', () => {
const mergedProduct = mergeProductWithItems_1.mergeProductWithItems(vtexProduct_1.vtexProductMock, itemsWithSimulationResponse_1.itemsWithSimulationResponseMock, 'default');
const [mergedItem] = mergedProduct.items;
const [mergedSeller] = mergedItem.sellers;
const [sellerFromSimulation] = itemsWithSimulationResponse_1.itemsWithSimulationResponseMock[0].sellers;
expect(mergedSeller.commertialOffer).toMatchObject(sellerFromSimulation.commertialOffer);
});
});