Renamed setNFCCapability to setNFC

This commit is contained in:
Alexander Cerutti
2021-10-11 23:45:20 +02:00
parent 6f3a7d2f6e
commit 3f6cc6c803
2 changed files with 7 additions and 7 deletions

View File

@@ -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",
}), }),

View File

@@ -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;