mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-03-10 08:01:20 +00:00
fix unit tests (#972)
This commit is contained in:
@@ -132,7 +132,7 @@ describe("Management", (): void => {
|
||||
|
||||
describe("MerchantAccount", (): void => {
|
||||
it("should support GET /merchants", async (): Promise<void> => {
|
||||
scope.get(`/merchants?pageNumber=1&pageSize=1`)
|
||||
scope.get("/merchants?pageNumber=1&pageSize=1")
|
||||
.reply(200, responses.listMerchantResponse);
|
||||
|
||||
const response: models.ListMerchantResponse = await management.MerchantAccount.list({
|
||||
@@ -146,7 +146,7 @@ describe("Management", (): void => {
|
||||
});
|
||||
|
||||
it("should support POST /merchants", async (): Promise<void> => {
|
||||
scope.post(`/merchants`)
|
||||
scope.post("/merchants")
|
||||
.reply(200, responses.createMerchantResponse);
|
||||
|
||||
const response: models.CreateMerchantResponse = await management.MerchantAccount.create(requests.createMerchantRequest);
|
||||
@@ -641,10 +641,10 @@ describe("Management", (): void => {
|
||||
});
|
||||
|
||||
it("should support POST /merchants/{merchantId}/webhooks/{webhookId}/test", async (): Promise<void> => {
|
||||
scope.post(`/merchants/${merchantId}/webhooks/${webhookId}/test`, /2022-07-15T00:00:00.000Z/)
|
||||
scope.post(`/merchants/${merchantId}/webhooks/${webhookId}/test`)
|
||||
.reply(200, responses.testWebhookResponse);
|
||||
|
||||
let testWebhookRequest = {
|
||||
const testWebhookRequest: models.TestWebhookRequest = {
|
||||
"notification": {
|
||||
"amount": {
|
||||
"currency": "string",
|
||||
|
||||
@@ -23,7 +23,7 @@ import { asyncRes } from "../__mocks__/terminalApi/async";
|
||||
import { syncRefund, syncRes, syncResEventNotification } from "../__mocks__/terminalApi/sync";
|
||||
import Client from "../client";
|
||||
import TerminalCloudAPI from "../services/terminalCloudAPI";
|
||||
import { TerminalApiResponse } from "../typings/terminal/models";
|
||||
import { SaleToAcquirerData, TerminalApiResponse } from "../typings/terminal/models";
|
||||
|
||||
let client: Client;
|
||||
let terminalCloudAPI: TerminalCloudAPI;
|
||||
@@ -94,7 +94,9 @@ describe("Terminal Cloud API", (): void => {
|
||||
const terminalAPIRefundRequest = createTerminalAPIRefundRequest(pOITransactionId);
|
||||
const id = Math.floor(Math.random() * Math.floor(10000000)).toString();
|
||||
terminalAPIRefundRequest.SaleToPOIRequest.MessageHeader.ServiceID = id;
|
||||
terminalAPIRefundRequest.SaleToPOIRequest.ReversalRequest!.SaleData!.SaleToAcquirerData!.currency = "EUR";
|
||||
const saleToAcquirerData: SaleToAcquirerData = new SaleToAcquirerData();
|
||||
saleToAcquirerData.currency = "EUR";
|
||||
terminalAPIRefundRequest.SaleToPOIRequest.ReversalRequest!.SaleData!.SaleToAcquirerData = saleToAcquirerData;
|
||||
const terminalAPIRefundResponse = await terminalCloudAPI.sync(terminalAPIRefundRequest);
|
||||
|
||||
expect(terminalAPIRefundResponse.SaleToPOIResponse?.ReversalResponse?.Response.Result).toBe("Success");
|
||||
|
||||
Reference in New Issue
Block a user