Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
renderOptions = {
createOrder: () => ZalgoPromise.resolve('order-id'),
onApprove: td.function(),
onError: td.function(),
fields: {
number: {
selector: '#credit-card'
}
}
};
fakeTokenizationPayload = {
payment_source: {
card: {
last_digits: '1111',
card_type: 'VISA'
}
},
links: []
beforeEach(() => {
renderOptions = {
createOrder: () => ZalgoPromise.resolve('order-id'),
onApprove: td.function(),
onError: td.function(),
fields: {
number: {
selector: '#credit-card'
}
}
};
fakeTokenizationPayload = {
payment_source: {
card: {
last_digits: '1111',
card_type: 'VISA'
}
},
links: []
};
beforeEach(() => {
button = document.createElement('button');
button.id = 'button';
renderOptions.createOrder = td.function();
if (document.body) {
document.body.appendChild(button);
}
td.when(renderOptions.createOrder()).thenReturn(orderId);
});