unit tests

This commit is contained in:
FrankRua 2022-05-03 12:58:26 -04:00
parent 694a3aabc7
commit a14e3ca682
3 changed files with 2 additions and 11 deletions

View file

@ -23,6 +23,7 @@ export function getMountOptions(mockData) {
mocks.pushPageViewToGA = jest.fn();
mocks.logEvent = jest.fn();
mocks.pushExperimentsToDataLayer = jest.fn();
mocks.prependActionToMethod = jest.fn();
mocks.dispatchStoreAction = jest.fn();
mocks.dispatchStoreAction.mockImplementation((actionName) => {

View file

@ -82,16 +82,7 @@ export default {
pushToDataLayerIfDefined(experimentWithDimension);
});
},
appendActionToMethod(object, method, actionToAppend) {
const baseMethod = object[method.name];
object[method.name] = function () {
var result = baseMethod.apply(object, arguments);
actionToAppend.apply(this, arguments);
return result;
};
},
prependActionToMethod(object, method, actionToPrepend) {
const baseMethod = object[method.name];
object[method.name] = function () {

View file

@ -79,5 +79,4 @@ describe("analyticsMixin.js", () => {
expect(window.dataLayer).toEqual([ { settings_5: {"Google Custom Dimension Index": "5"}, variationName_5: 'test', universeName_5: 'testUniverse' } ]);
});
});