mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 22:25:24 +00:00
Improved some other tests
This commit is contained in:
@@ -25,12 +25,7 @@ describe("PKPass", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
pass = new PKPass(
|
pass = new PKPass({});
|
||||||
{},
|
|
||||||
/** @ts-ignore - We don't need certificates here*/
|
|
||||||
baseCerts,
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("constructor", () => {
|
describe("constructor", () => {
|
||||||
@@ -456,8 +451,13 @@ describe("PKPass", () => {
|
|||||||
wwdr: "",
|
wwdr: "",
|
||||||
};
|
};
|
||||||
}).toThrow();
|
}).toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
/** Expecting previous result */
|
it("should accept complete object", () => {
|
||||||
|
pass.certificates = baseCerts;
|
||||||
|
expect(pass[certificatesSymbol]).toEqual(baseCerts);
|
||||||
|
|
||||||
|
pass = new PKPass({}, baseCerts);
|
||||||
expect(pass[certificatesSymbol]).toEqual(baseCerts);
|
expect(pass[certificatesSymbol]).toEqual(baseCerts);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1134,12 +1134,11 @@ describe("PKPass", () => {
|
|||||||
PKPass.from({}),
|
PKPass.from({}),
|
||||||
).toBeRejected(),
|
).toBeRejected(),
|
||||||
expectAsync(
|
expectAsync(
|
||||||
/** Missing certificates error */
|
/** Empty model validation error */
|
||||||
// @ts-expect-error
|
|
||||||
PKPass.from({ model: "" }),
|
PKPass.from({ model: "" }),
|
||||||
).toBeRejected(),
|
).toBeRejected(),
|
||||||
expectAsync(
|
expectAsync(
|
||||||
/** Missing model error */
|
/** Missing model error and no certificates */
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
PKPass.from({ certificates: {} }),
|
PKPass.from({ certificates: {} }),
|
||||||
).toBeRejected(),
|
).toBeRejected(),
|
||||||
|
|||||||
Reference in New Issue
Block a user