mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Renamed setNFCCapability to setNFC
This commit is contained in:
@@ -134,9 +134,9 @@ describe("PKPass", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("setNFCCapability", () => {
|
describe("setNFC", () => {
|
||||||
it("should reset instance.props['nfc'] if 'null' is passed as value", () => {
|
it("should reset instance.props['nfc'] if 'null' is passed as value", () => {
|
||||||
pass.setNFCCapability({
|
pass.setNFC({
|
||||||
encryptionPublicKey: "mimmo",
|
encryptionPublicKey: "mimmo",
|
||||||
message: "No message for you here",
|
message: "No message for you here",
|
||||||
});
|
});
|
||||||
@@ -146,14 +146,14 @@ describe("PKPass", () => {
|
|||||||
message: "No message for you here",
|
message: "No message for you here",
|
||||||
});
|
});
|
||||||
|
|
||||||
pass.setNFCCapability(null);
|
pass.setNFC(null);
|
||||||
|
|
||||||
expect(pass.props["nfc"]).toBeUndefined();
|
expect(pass.props["nfc"]).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should throw on invalid objects received", () => {
|
it("should throw on invalid objects received", () => {
|
||||||
expect(() =>
|
expect(() =>
|
||||||
pass.setNFCCapability({
|
pass.setNFC({
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
requiresAuth: false,
|
requiresAuth: false,
|
||||||
encryptionPublicKey: "Nope",
|
encryptionPublicKey: "Nope",
|
||||||
@@ -162,9 +162,9 @@ describe("PKPass", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should always return undefined", () => {
|
it("should always return undefined", () => {
|
||||||
expect(pass.setNFCCapability(null)).toBeUndefined();
|
expect(pass.setNFC(null)).toBeUndefined();
|
||||||
expect(
|
expect(
|
||||||
pass.setNFCCapability({
|
pass.setNFC({
|
||||||
encryptionPublicKey: "mimmo",
|
encryptionPublicKey: "mimmo",
|
||||||
message: "No message for you here",
|
message: "No message for you here",
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -872,7 +872,7 @@ export default class PKPass extends Bundle {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public setNFCCapability(nfc: Schemas.NFC | null): void {
|
public setNFC(nfc: Schemas.NFC | null): void {
|
||||||
if (nfc === null) {
|
if (nfc === null) {
|
||||||
delete this[propsSymbol]["nfc"];
|
delete this[propsSymbol]["nfc"];
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user