Added constructor check for buffers

This commit is contained in:
Alexander Cerutti
2021-11-14 00:42:14 +01:00
parent 3326fc29d7
commit 964be0802c
3 changed files with 30 additions and 7 deletions

View File

@@ -32,6 +32,18 @@ describe("PKPass", () => {
);
});
describe("constructor", () => {
it("should warn about a non-object buffer parameter", () => {
console.warn = jasmine.createSpy("warn");
pass = new PKPass(undefined, baseCerts);
expect(console.warn).toHaveBeenCalledWith(
Messages.INIT.INVALID_BUFFERS.replace("%s", "undefined"),
);
});
});
describe("setBeacons", () => {
it("should reset instance.props['beacons'] if 'null' is passed as value", () => {
pass.setBeacons({