UNPKG

domain-objects

Version:

A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.

27 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const test_fns_1 = require("test-fns"); const DomainEntity_1 = require("../../instantiation/DomainEntity"); const unpivotRef_1 = require("./unpivotRef"); describe('DomainPivotKey', () => { (0, test_fns_1.given)('a Payer', () => { let PayerRole; (function (PayerRole) { PayerRole["PRODUCER"] = "PRODUCER"; PayerRole["PROVIDER"] = "PROVIDER"; PayerRole["CUSTOMER"] = "CUSTOMER"; })(PayerRole || (PayerRole = {})); class Payer extends DomainEntity_1.DomainEntity { } Payer.unique = ['role', 'exid']; (0, test_fns_1.when)('we attempt to unpivot a pivot ref', () => { (0, test_fns_1.then)('it should satisfy unique ref', () => { const producerPivotRef = { PRODUCER: 'bert', }; const producerUniqueRef = (0, unpivotRef_1.unpivotRef)(producerPivotRef, 'role', 'exid'); }); }); }); }); //# sourceMappingURL=unpivotRef.test.js.map