Skip to content

Commit

Permalink
add createEmailTestUser to paymentRefund
Browse files Browse the repository at this point in the history
  • Loading branch information
brunacamposxx committed Nov 29, 2023
1 parent 4b8bcbb commit d217fb6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion e2e/paymentRefund/create.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import MercadoPago, { Payment, PaymentRefund } from '@src/index';
import { config } from '../e2e.config';
import { createCardToken } from '@src/mocks/createCardToken';
import { createEmailTestUser } from '@src/mocks/createEmailTestUser';
import type { PaymentRefundCreateData } from '@src/clients/paymentRefund/create/types';

describe('IT refunds, create', () => {
Expand All @@ -12,6 +13,8 @@ describe('IT refunds, create', () => {
const cardToken = await createCardToken(client.accessToken);
expect(cardToken).toHaveProperty('id');

const email = createEmailTestUser();

const paymentBody = {
body: {
additional_info: {
Expand All @@ -25,7 +28,7 @@ describe('IT refunds, create', () => {
]
},
payer: {
email: '[email protected]',
email,
},
transaction_amount: 110.00,
installments: 1,
Expand Down
5 changes: 4 additions & 1 deletion e2e/paymentRefund/get.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import MercadoPago, { Payment, PaymentRefund } from '@src/index';
import { config } from '../e2e.config';
import { createCardToken } from '@src/mocks/createCardToken';
import { createEmailTestUser } from '@src/mocks/createEmailTestUser';
import type { PaymentRefundGetData } from '@src/clients/paymentRefund/get/types';
import type { PaymentRefundCreateData } from '@src/clients/paymentRefund/create/types';

Expand All @@ -13,6 +14,8 @@ describe('IT refunds, get', () => {
const cardToken = await createCardToken(client.accessToken);
expect(cardToken).toHaveProperty('id');

const email = createEmailTestUser();

const paymentBody = {
body: {
additional_info: {
Expand All @@ -26,7 +29,7 @@ describe('IT refunds, get', () => {
]
},
payer: {
email: '[email protected]',
email,
},
transaction_amount: 140.00,
installments: 1,
Expand Down
5 changes: 4 additions & 1 deletion e2e/paymentRefund/list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import MercadoPago, { Payment, PaymentRefund } from '@src/index';
import { config } from '../e2e.config';
import { createCardToken } from '@src/mocks/createCardToken';
import { createEmailTestUser } from '@src/mocks/createEmailTestUser';
import type { PaymentRefundCreateData } from '@src/clients/paymentRefund/create/types';
import type { PaymentRefundListData } from '@src/clients/paymentRefund/list/types';

Expand All @@ -13,6 +14,8 @@ describe('IT refunds, list', () => {
const cardToken = await createCardToken(client.accessToken);
expect(cardToken).toHaveProperty('id');

const email = createEmailTestUser();

const paymentBody = {
body: {
additional_info: {
Expand All @@ -26,7 +29,7 @@ describe('IT refunds, list', () => {
]
},
payer: {
email: '[email protected]',
email,
},
transaction_amount: 110.00,
installments: 1,
Expand Down
4 changes: 3 additions & 1 deletion e2e/paymentRefund/total.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import MercadoPago, { Payment, PaymentRefund } from '@src/index';
import { config } from '../e2e.config';
import { createCardToken } from '@src/mocks/createCardToken';
import { createEmailTestUser } from '@src/mocks/createEmailTestUser';
import type { PaymentCreateData } from '@src/clients/payment/create/types';
import type { PaymentRefundTotalData } from '@src/clients/paymentRefund/total/types';

Expand Down Expand Up @@ -45,6 +46,7 @@ describe('IT refunds, total', () => {
}
}, 10000);

const email = createEmailTestUser();

function createPayment(token: string): PaymentCreateData {
const body = {
Expand All @@ -60,7 +62,7 @@ describe('IT refunds, total', () => {
]
},
payer: {
email: '[email protected]',
email,
},
transaction_amount: 110.00,
installments: 1,
Expand Down

0 comments on commit d217fb6

Please sign in to comment.