UNPKG

@signatu/policy

Version:
31 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var __1 = require("../.."); describe('PolicySection', function () { var section; beforeEach(function () { section = new __1.PolicySection("Test section"); section.ref = "https://foo.bar"; }); describe('serialization', function () { it('works with toJSON()', function () { var json = section.toJSON(); expect(json.masterText).toEqual('Test section'); expect(json.type).toEqual('PolicySection'); }); it('works with stringify()', function () { var jsonString = JSON.stringify(section); expect(jsonString).toContain('"masterText":"Test section"'); expect(jsonString).toContain('"type":"PolicySection"'); }); }); describe('deserializes', function () { it('correctly', function () { var s = JSON.stringify(section); var json = JSON.parse(s); var parsed = __1.PolicySection.fromJSON(json); expect(section).toEqual(parsed); }); }); }); //# sourceMappingURL=policySection.test.js.map