mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 22:25:24 +00:00
Updated specs
This commit is contained in:
@@ -26,12 +26,11 @@ describe("PKPass", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
pass = new PKPass({});
|
pass = new PKPass({});
|
||||||
|
console.warn = jasmine.createSpy("warn_logging");
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("constructor", () => {
|
describe("constructor", () => {
|
||||||
it("should warn about a non-object buffer parameter", () => {
|
it("should warn about a non-object buffer parameter", () => {
|
||||||
console.warn = jasmine.createSpy("warn");
|
|
||||||
|
|
||||||
pass = new PKPass(undefined, baseCerts);
|
pass = new PKPass(undefined, baseCerts);
|
||||||
|
|
||||||
expect(console.warn).toHaveBeenCalledWith(
|
expect(console.warn).toHaveBeenCalledWith(
|
||||||
@@ -343,18 +342,25 @@ describe("PKPass", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should ignore objects and values that not comply with Schema.Barcodes", () => {
|
it("should ignore objects and values that not comply with Schema.Barcodes", () => {
|
||||||
pass.setBarcodes(
|
const setBarcodesArguments: Parameters<typeof pass["setBarcodes"]> =
|
||||||
// @ts-expect-error
|
[
|
||||||
5,
|
// @ts-expect-error
|
||||||
10,
|
5,
|
||||||
15,
|
// @ts-expect-error
|
||||||
{
|
10,
|
||||||
message: "28363516282",
|
// @ts-expect-error
|
||||||
format: "PKBarcodeFormatPDF417",
|
15,
|
||||||
},
|
{
|
||||||
7,
|
message: "28363516282",
|
||||||
1,
|
format: "PKBarcodeFormatPDF417",
|
||||||
);
|
},
|
||||||
|
// @ts-expect-error
|
||||||
|
7,
|
||||||
|
// @ts-expect-error
|
||||||
|
1,
|
||||||
|
];
|
||||||
|
|
||||||
|
pass.setBarcodes(...setBarcodesArguments);
|
||||||
|
|
||||||
expect(pass.props["barcodes"].length).toBe(1);
|
expect(pass.props["barcodes"].length).toBe(1);
|
||||||
});
|
});
|
||||||
@@ -656,7 +662,6 @@ describe("PKPass", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should warn developer if no translations have been passed", () => {
|
it("should warn developer if no translations have been passed", () => {
|
||||||
console.warn = jasmine.createSpy("log");
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
pass.localize("en");
|
pass.localize("en");
|
||||||
pass.localize("en", {});
|
pass.localize("en", {});
|
||||||
@@ -939,7 +944,6 @@ describe("PKPass", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("Should warn user if no icons have been added to bundle", () => {
|
it("Should warn user if no icons have been added to bundle", () => {
|
||||||
console.warn = jasmine.createSpy("log");
|
|
||||||
pass[closePassSymbol](true);
|
pass[closePassSymbol](true);
|
||||||
|
|
||||||
expect(console.warn).toHaveBeenCalledWith(
|
expect(console.warn).toHaveBeenCalledWith(
|
||||||
|
|||||||
Reference in New Issue
Block a user