whodis-sdk
Version:
A simple sdk for easy, secure authentication with the whodis platform. Setup secure authentication for your app in seconds.
33 lines • 1.45 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dotenv_1 = __importDefault(require("dotenv"));
const domain_1 = require("../../domain");
const addUserContactMethod_1 = require("./addUserContactMethod");
dotenv_1.default.config();
if (!process.env.API_PUBLIC_KEY)
throw new Error('public key not defined');
if (!process.env.API_PRIVATE_KEY)
throw new Error('private key not defined');
describe('addUserContactMethod', () => {
it('should be able to add a contact method', async () => {
const user = await (0, addUserContactMethod_1.addUserContactMethod)({
userUuid: 'a403997e-f727-45ad-8afc-d4a99137f821',
contactMethod: {
type: domain_1.WhodisContactMethodType.EMAIL,
address: 'bobbert@snailmail.com',
},
}, {
credentials: {
publicKey: process.env.API_PUBLIC_KEY,
privateKey: process.env.API_PRIVATE_KEY,
},
});
expect(user).toHaveProperty('contactMethods');
expect(user?.contactMethods.length).toBeGreaterThan(0);
expect(user?.contactMethods.map((method) => method.address)).toContain('bobbert@snailmail.com');
});
});
//# sourceMappingURL=addUserContactMethod.integration.test.js.map