Socket
Socket
Sign inDemoInstall

@mx51/spi-client-js

Package Overview
Dependencies
7
Maintainers
14
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.8.1 to 2.8.2

src/Service/TenantsService.js

2

package.json
{
"name": "@mx51/spi-client-js",
"version": "2.8.1",
"version": "2.8.2",
"description": "JavaScript Client Library for mx51's In-Store Integration.",

@@ -5,0 +5,0 @@ "main": "dist/spi-client-js.js",

@@ -16,3 +16,3 @@ import { TransactionReportHelper } from "../src/TransactionReportHelper";

const posVendorId = "mx51";
const posVersion = "2.8.0";
const posVersion = "2.8.2";
const serialNumber = "321-321-321";

@@ -448,2 +448,39 @@ let fetchHelper;

describe("GetAvailableTenants()", () => {
it("should return the available tenants", async () => {
// arrange
const spi = new Spi(posId, "", eftposAddress, null);
fetchHelper.resolve({
json: () =>
Promise.resolve({
data: [
{
code: "gko",
name: "Gecko Demo Bank",
},
],
}),
}); // Mock the response from ReportTx
// act
const tenants = await Spi.GetAvailableTenants();
// assert
expect(tenants.Data[0].code).toBe("gko");
});
it("should return empty data when request fails", async () => {
const spi = new Spi(posId, "", eftposAddress, null);
fetchHelper.resolve({
json: () => Promise.reject({}),
}); // Mock the response from ReportTx
// act
const tenants = await Spi.GetAvailableTenants();
// assert
expect(tenants.Data.length).toBe(0);
});
});
describe("GetTerminalConfiguration()", () => {

@@ -450,0 +487,0 @@ it("should not initiate a GetTerminalConfiguration when not paired", () => {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc