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", () => {
pass.setNFCCapability({
pass.setNFC({
encryptionPublicKey: "mimmo",
message: "No message for you here",
});
@@ -146,14 +146,14 @@ describe("PKPass", () => {
message: "No message for you here",
});
pass.setNFCCapability(null);
pass.setNFC(null);
expect(pass.props["nfc"]).toBeUndefined();
});
it("should throw on invalid objects received", () => {
expect(() =>
pass.setNFCCapability({
pass.setNFC({
// @ts-expect-error
requiresAuth: false,
encryptionPublicKey: "Nope",
@@ -162,9 +162,9 @@ describe("PKPass", () => {
});
it("should always return undefined", () => {
expect(pass.setNFCCapability(null)).toBeUndefined();
expect(pass.setNFC(null)).toBeUndefined();
expect(
pass.setNFCCapability({
pass.setNFC({
encryptionPublicKey: "mimmo",
message: "No message for you here",
}),

View File

@@ -872,7 +872,7 @@ export default class PKPass extends Bundle {
* @returns
*/
public setNFCCapability(nfc: Schemas.NFC | null): void {
public setNFC(nfc: Schemas.NFC | null): void {
if (nfc === null) {
delete this[propsSymbol]["nfc"];
return;