Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('toggleEventListener', () => {
const needFixBatchComps = { batchComponentsAutoFixed: true };
const noNeedFixBatchComps = { batchComponentsAutoFixed: false };
expect(
helper.toggleEventListener(needFixBatchComps, needFixBatchComps)
).toEqual(undefined);
expect(
helper.toggleEventListener(needFixBatchComps, noNeedFixBatchComps)
).toEqual('removeEventListener');
expect(
helper.toggleEventListener(noNeedFixBatchComps, needFixBatchComps)
).toEqual('addEventListener');
});
});
it('toggleEventListener', () => {
const needFixBatchComps = { batchComponentsAutoFixed: true };
const noNeedFixBatchComps = { batchComponentsAutoFixed: false };
expect(
helper.toggleEventListener(needFixBatchComps, needFixBatchComps)
).toEqual(undefined);
expect(
helper.toggleEventListener(needFixBatchComps, noNeedFixBatchComps)
).toEqual('removeEventListener');
expect(
helper.toggleEventListener(noNeedFixBatchComps, needFixBatchComps)
).toEqual('addEventListener');
});
});
it('toggleEventListener', () => {
const needFixBatchComps = { batchComponentsAutoFixed: true };
const noNeedFixBatchComps = { batchComponentsAutoFixed: false };
expect(
helper.toggleEventListener(needFixBatchComps, needFixBatchComps)
).toEqual(undefined);
expect(
helper.toggleEventListener(needFixBatchComps, noNeedFixBatchComps)
).toEqual('removeEventListener');
expect(
helper.toggleEventListener(noNeedFixBatchComps, needFixBatchComps)
).toEqual('addEventListener');
});
});