Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IT Payments #270

Merged
merged 10 commits into from
Oct 11, 2023
Merged

Conversation

brunacamposxx
Copy link
Contributor

📝 Description

  • Add Integration test to Payments

import type { PaymentCreateData } from '@src/clients/payment/create/types';

describe('IT, cancel', () => {
test('should cancel Payment and match response object ', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test('should cancel Payment and match response object ', async () => {
test('should cancel Payment and match response object', async () => {

expect(cancelation).toHaveProperty('status', 'cancelled');
});

function createPayment(): PaymentCreateData {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be a function, it just needs to be a common variable., Do the same for all occurrences

const createPaymentBody = {
			body: {
				additional_info: {
					items: [
						{
							id: 'MLB2907679857',
							title: 'Point Mini',
							quantity: 1,
							unit_price: 58.8
						}
					]
				},
				payer: {
					email: '[email protected]',
				},
				transaction_amount: 110.00,
				installments: 1,
				payment_method_id: 'pix',
			}
	}


describe('IT, cancel', () => {
test('should cancel Payment and match response object ', async () => {
const client = new MercadoPago({ accessToken: config.access_token, options: { timeout: 5000 } });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the implementation simpler, let's remove the options part. Do the same for all occurrences

Suggested change
const client = new MercadoPago({ accessToken: config.access_token, options: { timeout: 5000 } });
const client = new MercadoPago({ accessToken: config.access_token });


describe('IT, capture', () => {
test('should capture, return partial transaction_amount passed at the request and match response object', async () => {
const client = new MercadoPago({ accessToken: config.access_token, options: { timeout: 5000 } });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the implementation simpler, let's remove the options part.

Suggested change
const client = new MercadoPago({ accessToken: config.access_token, options: { timeout: 5000 } });
const client = new MercadoPago({ accessToken: config.access_token });

@lucmkz lucmkz merged commit a25cca9 into mercadopago:master Oct 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants